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

Document monitoring customization #137

Closed
NassimBtk opened this issue Mar 26, 2024 · 0 comments · Fixed by #142
Closed

Document monitoring customization #137

NassimBtk opened this issue Mar 26, 2024 · 0 comments · Fixed by #142
Assignees
Labels
documentation Improvements or additions to documentation
Milestone

Comments

@NassimBtk
Copy link
Member

Description

While exploring the MetricsHub documentation, we noticed that the details on customizing metric collection for resources that do not have predefined connectors are not explicitly outlined. Since MetricsHub already supports this feature, we will enhance the documentation ( configure-agent.md) to highlight how users can leverage this capability.

Documentation Content Proposal

## Customizing Resource Monitoring

To enhance the monitoring of your resources via MetricsHub, you can tailor the data collection for each resource, even without a pre-existing connector available for those resources. This customization allows for the collection of new metrics, specifically designed to meet your requirements, ranging from basic availability tracking to advanced performance metric analysis.

### Configuration Overview

The monitored resource can be configured with a unique set of monitor jobs. These monitors define how MetricsHub collects and processes data for the resource. To configure a custom monitor, you will need to specify the monitor name, the type of job it performs (e.g., `simple` for straightforward monitoring tasks), and the data sources from which metrics are collected. Additionally, you will need to outline how these collected metrics are mapped to MetricsHub's monitoring model.

For detailed information on monitor types and configurations, please refer to our [monitors documentation page](../develop/monitors.md).

### Configuration Structure

Below is the general structure to follow when adding a custom monitor to your configuration:
<resource-group>:
  <resource-key>:
    attributes:
      # <attributes...>
    protocols:
      # <credentials...>
    monitors:
      <monitor-name>:
        <job>: # Job type, e.g., "simple"
          sources:
            <source-name>:
              # <source-content>
          mapping:
            source: <mapping-source-reference>
            attributes:
              # <attributes-mapping...>
            metrics:
              # <metrics-mapping...>
#### Example: Monitoring a Grafana Service

To illustrate, here is an example of how to configure a monitor for a Grafana service. This monitor collects data from the Grafana health API and maps the response to attributes and metrics in MetricsHub.
service-group:  
  grafana-service:
    attributes:
      service.name: Grafana
      host.name: hws-demo.sentrysoftware.com
    protocols:
      http:
        https: true
        port: 443
    monitors:
      grafana:
        simple: # Job type "simple". Creates monitors and collects associated metrics. 
          sources:
            grafanaHealth:
              type: http
              path: /api/health
              method: get
              header: "Accept: application/json"
              computes:
              - type: json2Csv
                entryKey: /
                properties: commit;database;version
                separator: ;
              - type: translate
                column: 3
                translationTable:
                  ok: 1
                  default: 0
          mapping:
            source: ${source::grafanaHealth}
            attributes:
              id: $2
              service.instance.id: $2
              service.version: $4
            metrics:
              grafana.db.state: $3
@NassimBtk NassimBtk added the documentation Improvements or additions to documentation label Mar 26, 2024
@iguitton iguitton added this to the Beta 1 milestone Mar 28, 2024
@iguitton iguitton linked a pull request Mar 28, 2024 that will close this issue
NassimBtk added a commit that referenced this issue Mar 28, 2024
…t-monitoring-customization

Issue #137: Documented custom resource monitoring
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants