-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[receiver/azuremonitor]: Support Azure gov cloud #27573
[receiver/azuremonitor]: Support Azure gov cloud #27573
Conversation
@@ -20,6 +20,10 @@ var ( | |||
errMissingClientID = errors.New(`ClientID" is not specified in config`) | |||
errMissingClientSecret = errors.New(`ClientSecret" is not specified in config`) | |||
errMissingFedTokenFile = errors.New(`FederatedTokenFile is not specified in config`) | |||
errInvalidCloud = errors.New(`Cloud" is invalid`) | |||
|
|||
azureCloud = "AzureCloud" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure these are the preferred names, but these are the names returned from running az cloud list
. Other tools use different conventions (e.g. terraform).
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
@codeboten @altuner can I get some feedback on this? |
@@ -18,6 +18,7 @@ import ( | |||
|
|||
const ( | |||
defaultCollectionInterval = 10 * time.Second | |||
defaultCloud = "AzureCloud" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use const "azureCloud" from config here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had to move config vars to constants. Let me know if that doesn't work
@@ -45,6 +45,7 @@ func TestNewFactory(t *testing.T) { | |||
CacheResourcesDefinitions: 24 * 60 * 60, | |||
MaximumNumberOfMetricsInACall: 20, | |||
Authentication: servicePrincipal, | |||
Cloud: azureCloud, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be defaultCloud?
```yaml | ||
receivers: | ||
azuremonitor: | ||
subscription_id: "${subscription_id}" | ||
tenant_id: "${tenant_id}" | ||
client_id: "${client_id}" | ||
client_secret: "${env:CLIENT_SECRET}" | ||
cloud: AzureUSGovernment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we put here default one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure. I wouldn't expect users to include this line at all when configuring the public cloud. They can also infer this from the bullets above but I thought a more complete example was nice. Happy to use the default tho if you think that makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@altuner just following up here and with the other changes.
@altuner @codeboten sorry to keep pinging but I would love to move this along so that I can use it in my collector. Anything I can do to make that happen please let me know! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the suggestion
type "Config" from package "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/azuremonitorreceiver" has invalid config settings: field "Cloud" has config tag "" which doesn't satisfy "^[a-z0-9][a-z0-9_]*$"
Co-authored-by: Alex Boten <[email protected]>
Support Azure gov cloud **Testing:** Ran against a government subscription --------- Co-authored-by: Alex Boten <[email protected]>
Support Azure gov cloud **Testing:** Ran against a government subscription --------- Co-authored-by: Alex Boten <[email protected]>
Description:
Support Azure gov cloud
Link to tracking Issue: N/A
Testing: Ran against a government subscription
Documentation: Updated README