Skip to content

Commit

Permalink
[Instrumentation] - Add CODEOWNERS and filter samples from pipeline (#…
Browse files Browse the repository at this point in the history
…19855)

## What

- Skip samples in CI
- Add CODEOWNERS entry and label
- Update the artifact name to fix CI
- Fix lint errors

## Why

We will be adding samples in #19854, but until we are able to we should disable
them in CI.
  • Loading branch information
maorleger authored Jan 18, 2022
1 parent d556043 commit b80091b
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 28 deletions.
5 changes: 4 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
/sdk/core/core-client-rest/ @xirzec @joheredi @jeremymeng @deyaaeldeen

# PRLabel: %Azure.Core
/sdk/core/core-tracing/ @xirzec @jeremymeng @maorleger
/sdk/core/core-tracing/ @xirzec @jeremymeng @maorleger @joheredi

# Service teams
# PRLabel: %App Configuration
Expand Down Expand Up @@ -69,6 +69,9 @@
# PRLabel: %KeyVault
/sdk/keyvault/ @maorleger @sadasant

# PRLabel: %OpenTelemetryInstrumentation
/sdk/instrumentation/ @maorleger @joheredi

# PRLabel: %Service Bus
/sdk/servicebus/ @deyaaeldeen @jeremymeng @HarshaNalluru @ramya-rao-a @richardpark-msft

Expand Down
4 changes: 2 additions & 2 deletions sdk/instrumentation/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ extends:
parameters:
ServiceDirectory: instrumentation
Artifacts:
- name: opentelemetry-instrumentation-azure-sdk
safeName: opentelemetryinstrumentationazuresdk
- name: azure-opentelemetry-instrumentation-azure-sdk
safeName: azureopentelemetryinstrumentationazuresdk
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import {
InstrumentationBase,
InstrumentationConfig,
} from "@opentelemetry/instrumentation";
import { OpenTelemetryInstrumenter } from "./instrumenter";
import { SDK_VERSION } from "./constants";
import { useInstrumenter } from "@azure/core-tracing";
import { OpenTelemetryInstrumenter } from "./instrumenter";

/**
* Configuration options that can be passed to {@link createAzureSdkInstrumentation} function.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

import type * as coreTracing from "@azure/core-tracing";
import {
Instrumentation,
InstrumentationBase,
InstrumentationConfig,
InstrumentationModuleDefinition,
InstrumentationNodeModuleDefinition,
} from "@opentelemetry/instrumentation";
import type * as coreTracing from "@azure/core-tracing";
import { OpenTelemetryInstrumenter } from "./instrumenter";
import { SDK_VERSION } from "./constants";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ import {
TracingContext,
TracingSpan,
} from "@azure/core-tracing";
import { context, defaultTextMapGetter, defaultTextMapSetter, trace } from "@opentelemetry/api";

import { trace, context, defaultTextMapGetter, defaultTextMapSetter } from "@opentelemetry/api";
import { W3CTraceContextPropagator } from "@opentelemetry/core";
import { OpenTelemetrySpanWrapper } from "./spanWrapper";

import { W3CTraceContextPropagator } from "@opentelemetry/core";
import { toSpanOptions } from "./transformations";

// While default propagation is user-configurable, Azure services always use the W3C implementation.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

import { Span, SpanAttributeValue, SpanStatusCode } from "@opentelemetry/api";
import { SpanStatus, TracingSpan } from "@azure/core-tracing";
import { Span, SpanStatusCode, SpanAttributeValue } from "@opentelemetry/api";

export class OpenTelemetrySpanWrapper implements TracingSpan {
private _span: Span;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

import { assert } from "chai";
import { OpenTelemetryInstrumenter, propagator } from "../../src/instrumenter";
import { trace, context, SpanKind } from "@opentelemetry/api";
import { SpanKind, context, trace } from "@opentelemetry/api";
import { TracingSpan, TracingSpanKind } from "@azure/core-tracing";
import { TestSpan } from "./util/testSpan";
import { TestTracer } from "./util/testTracer";
import { resetTracer, setTracer } from "./util/testTracerProvider";
import sinon from "sinon";
import { Context } from "mocha";
import { OpenTelemetrySpanWrapper } from "../../src/spanWrapper";
import { TestSpan } from "./util/testSpan";
import { TestTracer } from "./util/testTracer";
import { assert } from "chai";
import sinon from "sinon";

function unwrap(span: TracingSpan): TestSpan {
return (span as OpenTelemetrySpanWrapper).unwrap() as TestSpan;
Expand All @@ -25,15 +25,15 @@ describe("OpenTelemetryInstrumenter", () => {
});

it("uses the passed in context if it exists", () => {
let propagationSpy = sinon.spy(propagator);
const propagationSpy = sinon.spy(propagator);
const span = new TestTracer().startSpan("test");
let tracingContext = trace.setSpan(context.active(), span);
const tracingContext = trace.setSpan(context.active(), span);
instrumenter.createRequestHeaders(tracingContext);
assert.isTrue(propagationSpy.inject.calledWith(tracingContext));
});

it("uses the active context if no context was provided", () => {
let propagationSpy = sinon.spy(propagator);
const propagationSpy = sinon.spy(propagator);
instrumenter.createRequestHeaders();
const activeContext = context.active();
assert.isTrue(propagationSpy.inject.calledWith(activeContext));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

import { assert } from "chai";
import { OpenTelemetrySpanWrapper } from "../../src/spanWrapper";
import { SpanStatusCode } from "@opentelemetry/api";
import { TestSpan } from "./util/testSpan";
import { TestTracer } from "./util/testTracer";
import { assert } from "chai";

describe("OpenTelemetrySpanWrapper", () => {
let otSpan: TestSpan;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
// Licensed under the MIT license.

import {
TimeInput,
Tracer,
Link,
Span,
SpanAttributeValue,
SpanAttributes,
SpanContext,
SpanKind,
SpanStatus,
SpanContext,
SpanAttributes,
SpanStatusCode,
SpanAttributeValue,
Span,
Link,
TimeInput,
Tracer,
} from "@opentelemetry/api";

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

import { TestSpan } from "./testSpan";
import {
Context,
SpanContext,
SpanKind,
SpanOptions,
TraceFlags,
Context,
context,
Tracer,
context,
trace,
} from "@opentelemetry/api";

import { TestSpan } from "./testSpan";

/**
* Simple representation of a Span that only has name and child relationships.
* Children should be arranged in the order they were created.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ stages:
parameters:
PackageName: "@azure/opentelemetry-instrumentation-azure-sdk"
ServiceDirectory: instrumentation
MatrixFilters:
- TestType=^(?!sample).*
EnvVars:
AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id)
AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id)
Expand Down

0 comments on commit b80091b

Please sign in to comment.