question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for specifying sub/server type in resource discovery

See original GitHub issue

Proposal

I implemented the MySQL resource type a while ago, and while not a huge issue it is a bit annoying to see: The metric 'cpu_credits_remaining' was not found.

The reason for these errors is that metrics available differs from MySQL Single and Flexible servers. The same is true for PostgreSQL as well.

Currently there is no way, as far as I know, to filter resource discovery group on a server type / sub type of a resource type. This would be nice to have for these use cases, and probably others.

I might have time to implement this myself, but would like some implementation direction in that case.

Possible declerations, depending on implementation.

Filter in resource discovery:

version: v1
azureLandscape:
  tenantId: 00000000-0000-0000-0000-000000000000
  subscriptions:
    - 00000000-0000-0000-0000-000000000000
  cloud: Global
resourceDiscoveryGroups:
  - name: azure_mysql_single
    type: MySql
    subType: Single
  - name: azure_mysql_flexible
    type: MySql
    subType: Flexible

Filter in metric decleration:

  - name: azure_mysql_cpu_credits_remaining
    description: "CPU credits remaining"
    resourceType: MySql
    azureMetricConfiguration:
      metricName: cpu_credits_remaining
      aggregation:
        type: Average
        interval: 00:15:00
    resourceDiscoveryGroups:
      - name: azure_mysql
         subType: Flexible

Component

Resource Discovery

Contact Details

No response

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
MattiasAngcommented, Jun 9, 2022

I should be able to contribute this, C# skills are not the best but we’ll see.

Which of the alternative would you say is the best way to go? The second alternative (filtering in metric deceleration) would be quite nice otherwise there will be a lot of duplication in metric decelerations for these resources.

0reactions
tomkerkhovecommented, Jun 10, 2022

How do we handle it on the Resource Discovery API side if we want to have the “sub type” to be specific for each resource?

The API should be good, it’s how it is being configured and serialized/deserialized. You can learn more in the scraper on how it gets the metrics.

And secondly, I am trying to find where it would be best to filter the result of the query. My thought that we would still query resource graph for all resources regardless of specified “sub type” in resourceDiscoveryGroups and then filter afterwards.

We should filter this in the resource graph though. We already have query builders per type so have to plug in the new properties and use them there as well. Otherwise we’ll be pulling too much data and make too many calls.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Defining the Main Server and Its Subservers
Before you begin configuring a replication job, you must define the Server Manager instances that comprise the replication server group, including the Main ......
Read more >
Adding Subservers
To select a subserver from a list of discovered servers, perform the following steps: Click the ... Defining the Main Server and Its...
Read more >
Resource Discovery and Promotion
Promotion to full monitoring involves specifying additional identifying parameters and monitoring credentials in order to compete the discovery ...
Read more >
Understanding Discovery & Connection Data Structures
The event type and subtype fields further define the structure of the data record carried in the message. Host Discovery Structures by Event...
Read more >
Use a Subserver to Handle Large Loads - Documentation - Altair
The primary server must be used to submit, stop, and forget jobs. The subserver is to be used as a read-only server. While...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found