DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
The Latest "Software Integration: The Intersection of APIs, Microservices, and Cloud-Based Systems" Trend Report
Get the report
  1. DZone
  2. Data Engineering
  3. Data
  4. Filtering Metrics With the observIQ Distro for OpenTelemetry Collector

Filtering Metrics With the observIQ Distro for OpenTelemetry Collector

Save processing and data by easily filtering unneeded metrics before shipping.

Dylan Myers user avatar by
Dylan Myers
·
Feb. 05, 23 · Tutorial
Like (1)
Save
Tweet
Share
2.77K Views

Join the DZone community and get the full member experience.

Join For Free

In this tutorial, we will address the common monitoring use case of filtering metrics within observIQ’s distribution of the OpenTelemetry (OTEL) collector. Whether the metrics are deemed unnecessary, or they are filtered for security concerns, the process is fairly straightforward.

For our sample environment, we will use MySQL on Red Hat Enterprise Linux 8. The destination exporter will be to Google Cloud Operations, but the process is exporter agnostic. We are using this exporter to provide the visual charts showing the metric before and after filtering.

Environment Prerequisites

  • Suitable operating system
  • observIQ Distro for OTEL Collector installed
  • MySQL installed
  • MySQL Least Privilege User (LPU) setup
  • OTEL configured to collect metrics from MySQL

Resources

  • observIQ Distro for OTEL Collector Download
  • MySQL Receiver Documentation
  • MySQL Metadata File (Lists the Metrics)

Initial Metrics

Once configured using the LPU I created, MySQL metrics should be flowing. For our purposes, we will focus on the specific metric mysql.buffer_pool.limit. Currently, our config.yaml MySQL section looks like this:

YAML
 
mysql:
    endpoint: localhost:3306
    username: otel
    password: otelPassword
    collection_interval: 60s

After waiting for at least five minutes to get a good amount of data, metrics will look something like this in Google’s Metrics Explorer:

Filtering

Now that metrics are flowing, we can filter them. First, let us discuss the reasons to filter this specific metric. The answer is simple: It isn’t really all that useful or important. It will, barring a configuration change by the DBA, be a flat line. Even after a configuration change, it would simply step that flat line up or down.

To do the filtering, we first need to look at the metadata file for the MySQL receiver. In this file, we find a listing of the attributes and metrics associated with this receiver. If we go to the metrics section of the file, and find our pool limit metric, we learn it looks like this:

YAML
 
mysql.buffer_pool.limit:
	enabled: true
	description: The configured size of the InnoDB buffer pool.
	unit: By
	sum:
  	value_type: int
  	input_type: string
  	monotonic: false
  	aggregation: cumulative

This lets us know that it is enabled by default, gives a description, and some other important data about the metric. As these are the defaults, we can interpret from it that if we set the enabled parameter to false, then it should disable — aka filter — this metric. It will not be collected, and since it isn’t collected, it also will not be sent to the exporter.

To achieve this in our configuration file, we make the following changes:

YAML
 
 mysql:
    endpoint: localhost:3306
    username: otel
    password: otelPassword
    collection_interval: 60s
    metrics:
      mysql.buffer_pool.limit:
        enabled: false

This replicates the structure from the metadata file, but with everything else trimmed other than the bare minimum number of lines needed to achieve our goal.

Once this has been changed, and the collector restarted, I again wait at least five minutes and check Google’s Metrics Explorer to see what has changed:

As shown in the screenshot, data was last sent to Google at 10:48, and it is now 11:13.

Conclusion

While the information needed is located in a few different places, filtering is very easy to do. Don’t forget that the metadata we looked at also provides other information that can be useful in understanding your data.

MySQL Metadata YAML Data Types Event monitoring

Published at DZone with permission of Dylan Myers. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • What Is API-First?
  • Create Spider Chart With ReactJS
  • How Agile Architecture Spikes Are Used in Shift-Left BDD
  • MongoDB Time Series Benchmark and Review

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: