Skip to content

Commit

Permalink
[Azure Monitor OpenTelemetry] Update swagger definition file for Quic…
Browse files Browse the repository at this point in the history
…kpulse (#28931)

### Packages impacted by this PR
@azure/monitor-opentelemetry
  • Loading branch information
hectorhdzg authored Mar 15, 2024
1 parent c6b79e3 commit c7b91e5
Show file tree
Hide file tree
Showing 10 changed files with 504 additions and 434 deletions.
467 changes: 234 additions & 233 deletions sdk/monitor/monitor-opentelemetry/src/generated/models/index.ts

Large diffs are not rendered by default.

167 changes: 98 additions & 69 deletions sdk/monitor/monitor-opentelemetry/src/generated/models/mappers.ts

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

153 changes: 87 additions & 66 deletions sdk/monitor/monitor-opentelemetry/src/generated/quickpulseClient.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import { QuickpulseSender } from "./sender";
import {
DocumentIngress,
MonitoringDataPoint,
PostOptionalParams,
PostResponse,
PublishOptionalParams,
PublishResponse,
} from "../../../generated";
import { getTransmissionTime, resourceMetricsToQuickpulseDataPoint } from "../utils";

Expand All @@ -23,7 +23,7 @@ import { getTransmissionTime, resourceMetricsToQuickpulseDataPoint } from "../ut
*/
export class QuickpulseMetricExporter implements PushMetricExporter {
private sender: QuickpulseSender;
private postCallback: (response: PostResponse | undefined) => void;
private postCallback: (response: PublishResponse | undefined) => void;
private getDocumentsFn: () => DocumentIngress[];
// Monitoring data point with common properties
private baseMonitoringDataPoint: MonitoringDataPoint;
Expand Down Expand Up @@ -56,18 +56,18 @@ export class QuickpulseMetricExporter implements PushMetricExporter {
resultCallback: (result: ExportResult) => void,
): Promise<void> {
diag.info(`Exporting Live metrics(s). Converting to envelopes...`);
let optionalParams: PostOptionalParams = {
let optionalParams: PublishOptionalParams = {
monitoringDataPoints: resourceMetricsToQuickpulseDataPoint(
metrics,
this.baseMonitoringDataPoint,
this.getDocumentsFn(),
),
xMsQpsTransmissionTime: getTransmissionTime(),
transmissionTime: getTransmissionTime(),
};
// Supress tracing until OpenTelemetry Metrics SDK support it
await context.with(suppressTracing(context.active()), async () => {
try {
let postResponse = await this.sender.post(optionalParams);
let postResponse = await this.sender.publish(optionalParams);
this.postCallback(postResponse);
resultCallback({ code: ExportResultCode.SUCCESS });
} catch (error) {
Expand Down
Loading

0 comments on commit c7b91e5

Please sign in to comment.