Comments (6)
using Activity? activity = activitySource.CreateActivity("main", ActivityKind.Server);
activity?.Start();
activity?.SetTag("customTag", "customValue"); // should land in custom properties, and is working as expected.
activity?.SetTag("abc", "def"); // should land in custom properties, and is working as expected.
activity?.SetTag("http.user_agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0"); // original value is lost, but a derived value is used to populate client_browser.
activity?.SetTag("http.newconvetiontag", "special value"); // should land in custom properties, and is working as expected.
// older tag conventions
activity?.SetTag("http.method", "GET"); // See below
activity?.SetTag("http.url", "http://0.0.0.0:8080/v1/skus/privateClouds"); // method and url are forming the name
activity?.SetTag("http.status_code", 202); // must be an int, not a string - @rajkumar-rangaraj - is this by design to ignore non-int??
Left comments in above. It looks like some doc improvements are required to explain how the exporter maps tags to AppInsights concepts.
from azure-sdk-for-net.
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @cijothomas @rajkumar-rangaraj @reyang @TimothyMothra @vishweshbankwar.
from azure-sdk-for-net.
A related question is how do I set these two values using OpenTelemetry?
from azure-sdk-for-net.
May be related issues:
They are specifically about Resource attributes not being stored into Telemetry tables' customDimensions.
In your case, you are referring to Activity.Tags, right? The following?
Activity.Tags:
url.full: http://0.0.0.0:8080/v1/skus/privateClouds
http.response.status_code: 200
url.full could be mapped into RequestTelemetry.url - can you check there?
http.response.status_code could be mapped into RequestTelemetry.responseCode. can you check?
Can you share a minimal repro app?
from azure-sdk-for-net.
It looks like custom properties are indeed set. I was able to set the response code by making sure the value was an int. I did not have luck with url.full
, but the older http.url
worked only when I set http.method
. What still confuses me is why doesn't http.user_agent
show up? Here is the minimal repo: https://github.com/cataggar/net44163/blob/365f16210827e7b3edf093d7a0fae8d9338f63de/Program.cs
Activity.TraceId: 4d66de24e6e9c1df6de90727b00423fa
Activity.SpanId: f44710ae4a38ae80
Activity.TraceFlags: Recorded
Activity.ActivitySourceName: bug44163
Activity.DisplayName: main
Activity.Kind: Server
Activity.StartTime: 2024-05-21T15:27:05.9271900Z
Activity.Duration: 00:00:00.0006631
Activity.Tags:
customTag: customValue
abc: def
http.user_agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0
http.newconvetiontag: special value
http.method: GET
http.url: http://0.0.0.0:8080/v1/skus/privateClouds
http.status_code: 202
Resource associated with Activity:
telemetry.sdk.name: opentelemetry
telemetry.sdk.language: dotnet
telemetry.sdk.version: 1.8.1
service.name: unknown_service:net44163
from azure-sdk-for-net.
In the case of http.user_agent
, I see client_Browser
Firefox 72.0
. Is there no way to get the original value. May be just create a custom attirbute?
from azure-sdk-for-net.
Related Issues (20)
- Exception Information Missing HOT 1
- [QUERY] Is there a way to specify the api version in SAS Token? HOT 1
- [FEATURE REQ]Add List and Put functions in EncryptionScopeResource HOT 1
- [QUERY] How to mock SubscriptionCollection resources. HOT 2
- [QUERY] Why is ShareAccessTier Premium missing from the .NET SDK HOT 1
- [QUERY] How to add new access policy to key vault without deleting all existing access policies? HOT 2
- [BUG]: Upgrade Azure.Identity Microsoft.Identity.Client to latest version to resolve security vulnerability HOT 2
- [QUERY] Azure.Identity 1.11.4: how to use WebView2 control? HOT 17
- [QUERY] What is happening with EventGridClient class? HOT 3
- How can we Enable/Disable APIs and Operations in Azure API Management Using .NET SDK and or in Portal HOT 1
- [BUG] Azure Service Bus Timeout instead of correct response: MessagingEntityNotFound HOT 7
- [AppConfig] Update Live Tests for Filter By Tags Feature
- [BUG] Azure.Search.Documents performs vector search successfully, but results are "null" HOT 1
- [QUERY] OpenAI Assistants V2 on Azure - Activate File search on assistant + specify file_ids in message's attachments HOT 4
- infinite lease via break? HOT 2
- [FEATURE REQ] Open Telemetry Sample Request HOT 3
- [BUG] API consistency issue, ManagedIdentityCredential() does not read default values from environment variables, like other Credentials. HOT 1
- [BUG] [OpenAI] ClientResultException 400 Bad Request calling `AzureChatClient.CompleteChatAsync` with PineconeChatDataSource HOT 2
- [FEATURE REQ] Support IsStored for any string field in Azure AI Search HOT 2
- [BUG]Failed to download PEM certificate from azure.keyvault with failure "The provided key does not match the public key for this certificate" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azure-sdk-for-net.