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

Provide support for specifying a metrics namespace #1794

Open
tomkerkhove opened this issue Oct 12, 2021 · 9 comments
Open

Provide support for specifying a metrics namespace #1794

tomkerkhove opened this issue Oct 12, 2021 · 9 comments
Assignees
Labels
agents:scraper All issues related to the scraping agent feature All issues that are new features Hacktoberfest All issues available for contribution during Hacktoberfest help-wanted All issues where people can contribute to the project scraping All issues related to scraping

Comments

@tomkerkhove
Copy link
Owner

Proposal

Provide support for specifying a metrics namespace so that you can choose which one to use in case the provider supports it.

One example is Azure Application Insights that allows you to query the default metrics or custom ones which use azure.applicationinsights as metric namespace.

Component

Scraper

Contact Details

No response

@tomkerkhove tomkerkhove added the feature-request New feature requests label Oct 12, 2021
@tomkerkhove tomkerkhove added this to the Scraper - v2.6.0 milestone Oct 12, 2021
@tomkerkhove tomkerkhove self-assigned this Oct 12, 2021
@tomkerkhove tomkerkhove moved this to Todo in Promitor Roadmap Oct 12, 2021
@tomkerkhove
Copy link
Owner Author

When getting all metric definitions, we should add the metric namespace to it:

var metricsDefinitions = await _authenticatedAzureSubscription.MetricDefinitions.ListByResourceAsync(resourceId);
var metricDefinition = metricsDefinitions.SingleOrDefault(definition => definition.Name.Value.ToUpper() == metricName.ToUpper());
if (metricDefinition == null)

We have to extend our query to call .FilterByNamespace(<name>), when configured:

var metricQuery = metricDefinition.DefineQuery()
.StartingFrom(recordDateTime.AddDays(-5))
.EndsBefore(recordDateTime)
.WithAggregation(metricAggregation.ToString())
.WithInterval(metricsInterval);

@tomkerkhove tomkerkhove added agents:scraper All issues related to the scraping agent feature All issues that are new features scraping All issues related to scraping and removed feature-request New feature requests labels Nov 20, 2021
@tomkerkhove tomkerkhove moved this from Todo to In Progress in Promitor Roadmap Nov 20, 2021
@tomkerkhove tomkerkhove moved this from In Progress to Blocked in Promitor Roadmap Dec 1, 2021
@bogdansandu
Copy link

Hei,
Any update on this feature?
I need to use it for exactly this scenario you described (metrics from application insights, custom namespace).
Thank you!

@tomkerkhove
Copy link
Owner Author

Not yet as I've hit a limitation but looking for alternatives.

Sorry for the delay.

@marevers
Copy link

Is this feature still planned? We are looking for a way to scrape VM guest metrics with Promitor but seeing as those are in a different metrics namespace, for now there does not seem to be a way to do that.

@tomkerkhove
Copy link
Owner Author

This is definately still planned but hasn't been implemented yet. Are you open to taking a stab at this?

@tomkerkhove tomkerkhove removed this from the Scraper - v2.7.0 milestone Jun 29, 2022
@marevers
Copy link

marevers commented Jul 8, 2022

This is definately still planned but hasn't been implemented yet. Are you open to taking a stab at this?

Unfortunately, I do not really know my way around C# so this would be difficult for me to do.

@tomkerkhove
Copy link
Owner Author

No problem at all!

@tomkerkhove tomkerkhove added help-wanted All issues where people can contribute to the project Hacktoberfest All issues available for contribution during Hacktoberfest labels Sep 26, 2022
@MisterVVP
Copy link

Hi @tomkerkhove, I'm currently debugging this locally. Do you remember what was the problem you hit here? I have grabbed your commits and rebased from master, things seem to work with your commits

Any tips?

@tomkerkhove
Copy link
Owner Author

From what I recall, custom metric is not supported by using these APIs. But it's been a while so that might have changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agents:scraper All issues related to the scraping agent feature All issues that are new features Hacktoberfest All issues available for contribution during Hacktoberfest help-wanted All issues where people can contribute to the project scraping All issues related to scraping
Projects
Status: Blocked
Development

Successfully merging a pull request may close this issue.

4 participants