Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Monitor OpenTelemetry] Update Configuration Documentation to Include Log/Span Processors and Use SpanProcessors in Default Config #28597

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions sdk/monitor/monitor-opentelemetry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const options: AzureMonitorOpenTelemetryOptions = {
},
samplingRatio: 1,
instrumentationOptions: {
// Instrumentations generating traces
// Instrumentations generating traces
azureSdk: { enabled: true },
http: { enabled: true },
mongoDb: { enabled: true },
Expand All @@ -79,6 +79,8 @@ const options: AzureMonitorOpenTelemetryOptions = {
connectionString: "",
},
resource: resource
logRecordProcessors: [],
spanProcessors: []
};

useAzureMonitor(options);
Expand All @@ -88,14 +90,16 @@ useAzureMonitor(options);

|Property|Description|Default|
| ------------------------------- |------------------------------------------------------------------------------------------------------------|-------|
| azureMonitorExporterOptions | Azure Monitor OpenTelemetry Exporter Configuration. [More info here](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/monitor/monitor-opentelemetry-exporter) | | | |
| samplingRatio | Sampling ratio must take a value in the range [0,1], 1 meaning all data will sampled and 0 all Tracing data will be sampled out. | 1|
| azureMonitorExporterOptions | Azure Monitor OpenTelemetry Exporter Configuration. [More info here](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/monitor/monitor-opentelemetry-exporter) | | | |
| samplingRatio | Sampling ratio must take a value in the range [0,1], 1 meaning all data will sampled and 0 all Tracing data will be sampled out. | 1|
| instrumentationOptions| Allow configuration of OpenTelemetry Instrumentations. | {"http": { enabled: true },"azureSdk": { enabled: false },"mongoDb": { enabled: false },"mySql": { enabled: false },"postgreSql": { enabled: false },"redis": { enabled: false },"bunyan": { enabled: false }}|
| browserSdkLoaderOptions| Allow configuration of Web Instrumentations. | { enabled: false, connectionString: "" }
| resource | Opentelemetry Resource. [More info here](https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-resources) ||
| samplingRatio | Sampling ratio must take a value in the range [0,1], 1 meaning all data will sampled and 0 all Tracing data will be sampled out.
| enableLiveMetrics | Enable/Disable Live Metrics.
| enableStandardMetrics | Enable/Disable Standard Metrics.
| browserSdkLoaderOptions| Allow configuration of Web Instrumentations. | { enabled: false, connectionString: "" } |
| resource | Opentelemetry Resource. [More info here](https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-resources) ||
| samplingRatio | Sampling ratio must take a value in the range [0,1], 1 meaning all data will sampled and 0 all Tracing data will be sampled out. |
| enableLiveMetrics | Enable/Disable Live Metrics. |
| enableStandardMetrics | Enable/Disable Standard Metrics. |
| logRecordProcessors | Array of log record processors to register to the global logger provider. |
| spanProcessors | Array of span processors to register to the global tracer provider. |

Options could be set using configuration file `applicationinsights.json` located under root folder of @azure/monitor-opentelemetry package installation folder, Ex: `node_modules/@azure/monitor-opentelemetry`. These configuration values will be applied to all AzureMonitorOpenTelemetryClient instances.

Expand Down
2 changes: 1 addition & 1 deletion sdk/monitor/monitor-opentelemetry/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export function useAzureMonitor(options?: AzureMonitorOpenTelemetryOptions) {
logRecordProcessor: logHandler.getAzureLogRecordProcessor(),
resource: config.resource,
sampler: traceHandler.getSampler(),
spanProcessor: traceHandler.getAzureMonitorSpanProcessor(),
spanProcessors: [traceHandler.getAzureMonitorSpanProcessor()],
};
sdk = new NodeSDK(sdkConfig);
setSdkPrefix();
Expand Down