Skip to content

Commit 8c6a412

Browse files
authored
[Azure Monitor OpenTelemetry Distro] Rename azureMonitorExporterConfig (Azure#27063)
Addressing API review requested changes
1 parent 337b850 commit 8c6a412

File tree

19 files changed

+51
-51
lines changed

19 files changed

+51
-51
lines changed

sdk/monitor/monitor-opentelemetry/review/monitor-opentelemetry.api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { Resource } from '@opentelemetry/resources';
1010

1111
// @public
1212
export interface AzureMonitorOpenTelemetryOptions {
13-
azureMonitorExporterConfig?: AzureMonitorExporterOptions;
13+
azureMonitorExporterOptions?: AzureMonitorExporterOptions;
1414
instrumentationOptions?: InstrumentationOptions;
1515
resource?: Resource;
1616
samplingRatio?: number;

sdk/monitor/monitor-opentelemetry/samples-dev/customMetric.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import * as dotenv from "dotenv";
1717
dotenv.config();
1818

1919
const options: AzureMonitorOpenTelemetryOptions = {
20-
azureMonitorExporterConfig: {
20+
azureMonitorExporterOptions: {
2121
connectionString:
2222
process.env["APPLICATIONINSIGHTS_CONNECTION_STRING"] || "<your connection string>",
2323
},

sdk/monitor/monitor-opentelemetry/samples-dev/customTrace.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import * as dotenv from "dotenv";
1717
dotenv.config();
1818

1919
const options: AzureMonitorOpenTelemetryOptions = {
20-
azureMonitorExporterConfig: {
20+
azureMonitorExporterOptions: {
2121
connectionString:
2222
process.env["APPLICATIONINSIGHTS_CONNECTION_STRING"] || "<your connection string>",
2323
},

sdk/monitor/monitor-opentelemetry/src/logs/handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export class LogHandler {
3232
resource: this._config.resource,
3333
};
3434
this._loggerProvider = new LoggerProvider(loggerProviderConfig);
35-
this._azureExporter = new AzureMonitorLogExporter(this._config.azureMonitorExporterConfig);
35+
this._azureExporter = new AzureMonitorLogExporter(this._config.azureMonitorExporterOptions);
3636
// Log Processor could be configured through env variables
3737
// https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/#batch-logrecord-processor
3838
this._logRecordProcessor = new BatchLogRecordProcessor(this._azureExporter);

sdk/monitor/monitor-opentelemetry/src/metrics/handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class MetricHandler {
4040
resource: this._config.resource,
4141
};
4242
this._meterProvider = new MeterProvider(meterProviderConfig);
43-
this._azureExporter = new AzureMonitorMetricExporter(this._config.azureMonitorExporterConfig);
43+
this._azureExporter = new AzureMonitorMetricExporter(this._config.azureMonitorExporterOptions);
4444
let metricReaderOptions: PeriodicExportingMetricReaderOptions = {
4545
exporter: this._azureExporter as any,
4646
exportIntervalMillis: options?.collectionInterval || this._collectionInterval,

sdk/monitor/monitor-opentelemetry/src/metrics/standardMetrics.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export class StandardMetrics {
5050
resource: this._config.resource,
5151
};
5252
this._meterProvider = new MeterProvider(meterProviderConfig);
53-
this._azureExporter = new AzureMonitorMetricExporter(this._config.azureMonitorExporterConfig);
53+
this._azureExporter = new AzureMonitorMetricExporter(this._config.azureMonitorExporterOptions);
5454
const metricReaderOptions: PeriodicExportingMetricReaderOptions = {
5555
exporter: this._azureExporter as any,
5656
exportIntervalMillis: options?.collectionInterval || this._collectionInterval,

sdk/monitor/monitor-opentelemetry/src/shared/config.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class InternalConfig implements AzureMonitorOpenTelemetryOptions {
1919
/** The rate of telemetry items tracked that should be transmitted (Default 1.0) */
2020
public samplingRatio: number;
2121
/** Azure Monitor Exporter Configuration */
22-
public azureMonitorExporterConfig: AzureMonitorExporterOptions;
22+
public azureMonitorExporterOptions: AzureMonitorExporterOptions;
2323
/**
2424
* OpenTelemetry Instrumentations configuration included as part of Azure Monitor (azureSdk, http, mongoDb, mySql, postgreSql, redis, redis4)
2525
*/
@@ -43,7 +43,7 @@ export class InternalConfig implements AzureMonitorOpenTelemetryOptions {
4343
*/
4444
constructor(options?: AzureMonitorOpenTelemetryOptions) {
4545
// Default values
46-
this.azureMonitorExporterConfig = {};
46+
this.azureMonitorExporterOptions = {};
4747
this.samplingRatio = 1;
4848
this.instrumentationOptions = {
4949
http: { enabled: true },
@@ -61,9 +61,9 @@ export class InternalConfig implements AzureMonitorOpenTelemetryOptions {
6161
// This will take precedence over other settings
6262
if (options) {
6363
// Merge default with provided options
64-
this.azureMonitorExporterConfig = Object.assign(
65-
this.azureMonitorExporterConfig,
66-
options.azureMonitorExporterConfig
64+
this.azureMonitorExporterOptions = Object.assign(
65+
this.azureMonitorExporterOptions,
66+
options.azureMonitorExporterOptions
6767
);
6868
this.instrumentationOptions = Object.assign(
6969
this.instrumentationOptions,
@@ -80,9 +80,9 @@ export class InternalConfig implements AzureMonitorOpenTelemetryOptions {
8080
this.samplingRatio =
8181
jsonConfig.samplingRatio !== undefined ? jsonConfig.samplingRatio : this.samplingRatio;
8282

83-
this.azureMonitorExporterConfig = Object.assign(
84-
this.azureMonitorExporterConfig,
85-
jsonConfig.azureMonitorExporterConfig
83+
this.azureMonitorExporterOptions = Object.assign(
84+
this.azureMonitorExporterOptions,
85+
jsonConfig.azureMonitorExporterOptions
8686
);
8787
this.instrumentationOptions = Object.assign(
8888
this.instrumentationOptions,

sdk/monitor/monitor-opentelemetry/src/shared/jsonConfig.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export class JsonConfig implements AzureMonitorOpenTelemetryOptions {
1818
/** The rate of telemetry items tracked that should be transmitted (Default 1.0) */
1919
public samplingRatio?: number;
2020
/** Azure Monitor Exporter Configuration */
21-
public azureMonitorExporterConfig?: AzureMonitorExporterOptions;
21+
public azureMonitorExporterOptions?: AzureMonitorExporterOptions;
2222
/**
2323
* OpenTelemetry Instrumentations configuration included as part of Azure Monitor (azureSdk, http, mongoDb, mySql, postgreSql, redis, redis4)
2424
*/
@@ -69,7 +69,7 @@ export class JsonConfig implements AzureMonitorOpenTelemetryOptions {
6969
}
7070
try {
7171
const jsonConfig: AzureMonitorOpenTelemetryOptions = JSON.parse(jsonString);
72-
this.azureMonitorExporterConfig = jsonConfig.azureMonitorExporterConfig;
72+
this.azureMonitorExporterOptions = jsonConfig.azureMonitorExporterOptions;
7373
this.samplingRatio = jsonConfig.samplingRatio;
7474
this.instrumentationOptions = jsonConfig.instrumentationOptions;
7575
} catch (err) {

sdk/monitor/monitor-opentelemetry/src/shared/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ process.env["AZURE_MONITOR_DISTRO_VERSION"] = AZURE_MONITOR_OPENTELEMETRY_VERSIO
1414
*/
1515
export interface AzureMonitorOpenTelemetryOptions {
1616
/** Azure Monitor Exporter Configuration */
17-
azureMonitorExporterConfig?: AzureMonitorExporterOptions;
17+
azureMonitorExporterOptions?: AzureMonitorExporterOptions;
1818
/** OpenTelemetry Resource */
1919
resource?: Resource;
2020
/** The rate of telemetry items tracked that should be transmitted (Default 1.0) */

sdk/monitor/monitor-opentelemetry/src/traces/handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export class TraceHandler {
5656
forceFlushTimeoutMillis: 30000,
5757
};
5858
this._tracerProvider = new NodeTracerProvider(tracerConfig);
59-
this._azureExporter = new AzureMonitorTraceExporter(this._config.azureMonitorExporterConfig);
59+
this._azureExporter = new AzureMonitorTraceExporter(this._config.azureMonitorExporterOptions);
6060
const bufferConfig: BufferConfig = {
6161
maxExportBatchSize: 512,
6262
scheduledDelayMillis: 5000,

0 commit comments

Comments
 (0)