-
Notifications
You must be signed in to change notification settings - Fork 5k
Open
Labels
Monitor - DistroMonitor OpenTelemetry DistroMonitor OpenTelemetry DistroMonitor - ExporterMonitor OpenTelemetry ExporterMonitor OpenTelemetry Exportercustomer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamWorkflow: This issue needs attention from Azure service team or SDK team
Description
I'm opening this issue to track and consolidate all other reported instances of this problem.
Currently, the Azure Monitor Exporter does not export any custom attribute added to the Resource Attributes.
This affects all 3 signals; Traces, Metrics, and Logs.
This is a highly requested feature and this is on our backlog.
Affected Libraries
- Azure.Monitor.OpenTelemetry.Exporter
- Azure.Monitor.OpenTelemetry.AspNetCore
How to Reproduce
var testResourceAttributes = new Dictionary<string, object>()
{
// THESE ATTRIBUTES DESCRIBE YOUR SERVICE AND WILL BE EXPORTED
{ "service.instance.id", "testInstance" },
{ "service.name", "testName" },
{ "service.namespace", "testNamespace" },
{ "service.version", "testVersion" },
// CUSTOM ATTRIBUTES ARE NOT EXPORTED TODAY
{ "customAttribute", "customValue" },
};
var tracerProvider = Sdk.CreateTracerProviderBuilder()
.ConfigureResource(x => x.AddAttributes(testResourceAttributes))
.AddAzureMonitorTraceExporter()
.Build();
var meterProvider = Sdk.CreateMeterProviderBuilder()
.ConfigureResource(x => x.AddAttributes(testResourceAttributes))
.AddAzureMonitorMetricExporter()
.Build();
var loggerFactory = LoggerFactory.Create(builder =>
{
builder
.AddOpenTelemetry(options =>
{
options.SetResourceBuilder(ResourceBuilder.CreateDefault().AddAttributes(testResourceAttributes));
options.AddAzureMonitorLogExporter();
});
});
Workaround
A custom processor can be used to add additional properties to Traces and Logs.
Reported Issues
- [FEATURE REQ] Value of attribute deployment.environment is not being sent to app insights #35487
- [FEATURE REQ] Resource Tags not saved to sink with OpenTelemetryMetrics #40630
- OpenTelemetry Resource Attributes are not exported to Azure Monitor #44257
- [FEATURE REQ] Azure Monitor to export resource attributes for logs #45251
- [FEATURE REQ] OpenTelemetry logging not passing Resource attributes #40951
Daniel-Svensson, koenvanderlinden, duvholt, shreve, dwserg and 7 more
Metadata
Metadata
Assignees
Labels
Monitor - DistroMonitor OpenTelemetry DistroMonitor OpenTelemetry DistroMonitor - ExporterMonitor OpenTelemetry ExporterMonitor OpenTelemetry Exportercustomer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamWorkflow: This issue needs attention from Azure service team or SDK team