-
-
Notifications
You must be signed in to change notification settings - Fork 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
feat: SDK migration single resource scraping #2470
feat: SDK migration single resource scraping #2470
Conversation
Thank you for your contribution! 🙏 We will review it as soon as possible. |
src/Promitor.Integrations.AzureMonitor/HttpPipelinePolicies/RecordArmRateLimitMetricsPolicy.cs
Show resolved
Hide resolved
This should be covered by the testing sweet so no worries! |
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.
Thanks for doing this, added some comments but good first step!
src/Promitor.Core.Scraping/Configuration/Model/MetricsDeclaration.cs
Outdated
Show resolved
Hide resolved
src/Promitor.Core.Scraping/Configuration/Serialization/v1/Core/V1Deserializer.cs
Outdated
Show resolved
Hide resolved
src/Promitor.Core.Scraping/Configuration/Serialization/v1/Model/MetricsDeclarationV1.cs
Outdated
Show resolved
Hide resolved
src/Promitor.Integrations.AzureMonitor/AzureMonitorClientLegacy.cs
Outdated
Show resolved
Hide resolved
var request = message.Request; | ||
string agentVersion = Version.Get(); | ||
var promitorUserAgent = ArmUserAgent.Generate(agentVersion, _metricSinkWriter.EnabledMetricSinks); | ||
request.Headers.Remove(HttpHeader.Names.UserAgent); | ||
request.Headers.Add(HttpHeader.Names.UserAgent, promitorUserAgent); |
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.
This can be moved to a dedicated method and called in respective Process methods, or not?
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.
Same comment here, decided it made more sense to thrown an exception on the synchronous path instead.
src/Promitor.Integrations.AzureMonitor/HttpPipelinePolicies/RegisterPromitorAgentPolicy.cs
Show resolved
Hide resolved
src/Promitor.Integrations.AzureMonitor/HttpPipelinePolicies/RecordArmRateLimitMetricsPolicy.cs
Show resolved
Hide resolved
src/Promitor.Integrations.AzureMonitor/HttpPipelinePolicies/RecordArmRateLimitMetricsPolicy.cs
Show resolved
Hide resolved
Are these pipeline steps something I can repeatedly trigger on my own? I read the README more carefully and it seems like I can find my branch build under |
Hey, there are docs how to run things locally here: https://github.com/tomkerkhove/promitor/blob/master/CONTRIBUTING.md#net-development The CI also runs all these integration tests automatically in case you were wondering |
…ion.cs Co-authored-by: Tom Kerkhove <[email protected]>
Looks like all tests are passing now! The failing Do you mind taking another look? Please ignore the log statements and modification to GitHub action for now. We can remove those before pressing the merge button |
Also, any pointers on how to do remote debugging? I've found some online articles on remote debugging with VS Code + .NET + Kubernetes. Probably should have tried that to begin with instead of doing so many print statements.. |
No, I always use VS to run the container locally and troubleshoot. If a running instance does not provide the insights you need, then we may be missing some logs |
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.
Requesting changes to ensure we revert the GitHub action changes, but otherwise it looks good and added some small comments.
Thanks a ton!!
src/Promitor.Core.Scraping/Configuration/Serialization/v1/Core/AzureMetadataDeserializer.cs
Show resolved
Hide resolved
.MapUsing(DetermineAzureCloud); | ||
} | ||
|
||
// TODO: validate cloud configuration in a SDK-agnostic way |
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.
Can you open an issue and link to it here please?
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 used azureCloud.DetermineMetricsClientAudience() for validation, see comment above
Also, I believe there should be two quick PRs to
Be on the look out :) |
Promitor documentation PR: promitor/docs#62 I believe they are dependencies of the next release but not this PR getting merged. I'm making this distinction because I'm waiting on merge to master to rebase and continue batch scraping work. No rush though. Thanks! |
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.
Thanks a ton for doing this and not giving up after all my comments!
This PR implements the Azure Monitor SDK migration. It migrates away from the deprecated Azure Fluent SDK to Azure SDK for .NET. Specifically, it uses the Azure.Monitor.Query package to implement integration. Since the new SDK is essentially a different wrapper around the same REST API, I'd expect identical behavior in terms of
A summary of how I did it:
IAzureMonitorClient
interface.IAzureMonitorClient
interfaceThings I need help with:
Relates to #2209