https://github.com/optum/telemetry-metrics-parser
Parses out metrics from different formats to Ruby hashes. Currently supports InfluxDB Line Protocol
https://github.com/optum/telemetry-metrics-parser
influxdb ruby telemetry
Last synced: about 1 year ago
JSON representation
Parses out metrics from different formats to Ruby hashes. Currently supports InfluxDB Line Protocol
- Host: GitHub
- URL: https://github.com/optum/telemetry-metrics-parser
- Owner: Optum
- License: apache-2.0
- Created: 2021-06-23T21:29:21.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2022-09-30T16:57:52.000Z (over 3 years ago)
- Last Synced: 2025-04-14T15:22:01.350Z (about 1 year ago)
- Topics: influxdb, ruby, telemetry
- Language: Ruby
- Homepage:
- Size: 37.1 KB
- Stars: 1
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# Telemetry::Metrics::Parser
A ruby gem designed to parse and process telemetry style metrics
## InfluxDB Line Protocol
```
# weather,location=us-midwest temperature=82 1465839830100400200
# | -------------------- -------------- |
# | | | |
# | | | |
# +-----------+--------+-+---------+-+---------+
# |measurement|,tag_set| |field_set| |timestamp|
# +-----------+--------+-+---------+-+---------+
```
Example
```ruby
require 'telemetry/metrics/parser'
results = Telemetry::Metrics::Parser.line_protocol('weather,location=us-midwest temperature=82 1465839830100400200')
results[:measurement] # => weather
results[:tags] # => { location: 'us-midwest' }
results[:fields] # => { temperature: 82 }
results[:timestamp] # => 1465839830100400200
```
#### Validations
```ruby
Telemetry::Metrics::Parser::LineProtocol.line_is_valid?('weather,location=us-midwest temperature=82 1465839830100400200') # true
Telemetry::Metrics::Parser::LineProtocol.line_is_valid?('weather,location=us-midwest temperature=this_field_is_a_string 1465839830100400200') # false but returned as a string error
```
Authors
----------
* [Matthew Iverson](https://github.com/Esity) - current maintainer