-
Notifications
You must be signed in to change notification settings - Fork 8
Add option to use custom domain for A365 service #92
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
4f11822
Use custom domain for A365 service
jsl517 88fe834
comments
jsl517 c211975
comments
jsl517 fc616b5
test update
jsl517 f9c63d1
comment
jsl517 4774591
comment
jsl517 65dea86
comment
jsl517 bead202
build failure
jsl517 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,31 +1,61 @@ | ||
| import { OpenTelemetryConstants } from './constants'; | ||
|
|
||
|
|
||
| /** | ||
| * Check if exporter is enabled via environment variables | ||
| */ | ||
| export const isAgent365ExporterEnabled: () => boolean = (): boolean => { | ||
| const enableA365Exporter = process.env[OpenTelemetryConstants.ENABLE_A365_OBSERVABILITY_EXPORTER]?.toLowerCase(); | ||
|
|
||
| return ( | ||
| enableA365Exporter === 'true' || | ||
| enableA365Exporter === '1' || | ||
| enableA365Exporter === 'yes' || | ||
| enableA365Exporter === 'on' | ||
| ); | ||
| }; | ||
|
|
||
| /** | ||
| * Gets the enable telemetry configuration value | ||
| */ | ||
| export const isAgent365TelemetryEnabled: () => boolean = (): boolean => { | ||
| const enableObservability = process.env[OpenTelemetryConstants.ENABLE_OBSERVABILITY]?.toLowerCase(); | ||
| const enableA365 = process.env[OpenTelemetryConstants.ENABLE_A365_OBSERVABILITY]?.toLowerCase(); | ||
|
|
||
| return ( | ||
| enableObservability === 'true' || | ||
| enableObservability === '1' || | ||
| enableA365 === 'true' || | ||
| enableA365 === '1' | ||
| ); | ||
| }; | ||
| // ------------------------------------------------------------------------------ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
| // ------------------------------------------------------------------------------ | ||
|
|
||
| import { OpenTelemetryConstants } from './constants'; | ||
| import { ClusterCategory } from '@microsoft/agents-a365-runtime'; | ||
| /** | ||
| * Check if exporter is enabled via environment variables | ||
| */ | ||
| export const isAgent365ExporterEnabled: () => boolean = (): boolean => { | ||
| const enableA365Exporter = process.env[OpenTelemetryConstants.ENABLE_A365_OBSERVABILITY_EXPORTER]?.toLowerCase(); | ||
|
|
||
| return ( | ||
| enableA365Exporter === 'true' || | ||
| enableA365Exporter === '1' || | ||
| enableA365Exporter === 'yes' || | ||
| enableA365Exporter === 'on' | ||
| ); | ||
| }; | ||
|
|
||
| /** | ||
| * Gets the enable telemetry configuration value | ||
| */ | ||
| export const isAgent365TelemetryEnabled: () => boolean = (): boolean => { | ||
| const enableObservability = process.env[OpenTelemetryConstants.ENABLE_OBSERVABILITY]?.toLowerCase(); | ||
| const enableA365 = process.env[OpenTelemetryConstants.ENABLE_A365_OBSERVABILITY]?.toLowerCase(); | ||
|
|
||
| return ( | ||
| enableObservability === 'true' || | ||
| enableObservability === '1' || | ||
| enableA365 === 'true' || | ||
| enableA365 === '1' | ||
| ); | ||
| }; | ||
|
|
||
| /** | ||
| * Single toggle to use custom domain for observability export. | ||
| * When true exporter will send traces to custom Agent365 service endpoint | ||
| * and include x-ms-tenant-id in headers. | ||
| */ | ||
| export const useCustomDomainForObservability = (): boolean => { | ||
| const value = process.env.A365_OBSERVABILITY_USE_CUSTOM_DOMAIN?.toLowerCase(); | ||
| return ( | ||
| value === 'true' || | ||
| value === '1' || | ||
| value === 'yes' || | ||
| value === 'on' | ||
|
fpfp100 marked this conversation as resolved.
|
||
| ); | ||
| }; | ||
|
|
||
| /** | ||
| * Resolve the Agent365 service endpoint base URI for a given cluster category. | ||
|
fpfp100 marked this conversation as resolved.
|
||
| */ | ||
| export function resolveAgent365Endpoint(clusterCategory: ClusterCategory): string { | ||
| switch (clusterCategory) { | ||
| case 'prod': | ||
|
fpfp100 marked this conversation as resolved.
|
||
| default: | ||
| return 'https://agent365.svc.cloud.microsoft'; | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.