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

Adds typespec-azure-telemetry package #2156

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

chrisradek
Copy link
Member

No description provided.

@azure-sdk
Copy link
Collaborator

All changed packages have been documented.

  • @azure-tools/typespec-azure-telemetry
Show changes

@azure-tools/typespec-azure-telemetry - feature ✏️

Adds the @azure-tools/typespec-azure-telemetry package

@azure-sdk
Copy link
Collaborator

You can try these changes here

🛝 Playground 🌐 Website 📚 Next docs

@@ -0,0 +1,7 @@
---
changeKind: feature
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
changeKind: feature
changeKind: internal

Just as it will show up in the following version otherwise

@@ -0,0 +1,31 @@
import { ExtensionConfig } from "../reporters/types.js";

export function getFetchHttpOverride(): ExtensionConfig["httpXHROverride"] {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whats the reason for those overrides, can add a comment?

import * as https from "https";
import { ExtensionConfig } from "../reporters/types.js";

export function getNodeHttpOverride(): ExtensionConfig["httpXHROverride"] {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here


const appInsightsClient = getAppInsightsClient({
instrumentationKey: props.instrumentationKey,
httpXHROverride: supportsFetch() ? getFetchHttpOverride() : getNodeHttpOverride(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't we always have fetch? compiler depends on it too


Telemetry collection is on by default.

To opt out, set the environment variable `DISABLE_TYPESPEC_AZURE_TELEMETRY` to a truthy value.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can add basic docs on how to use this package?

} catch {
// ignore error
}
return;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens if it errors out? no session id or empty id?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No sessionId in that case. It will still show up in app insights, but each event will be treated as being part of their own session.

That said - this file is mostly inconsequential for now since we'll use the NoOpTelemetryReporter in browser builds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants