-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Openmetrics support using textparser #27269
Merged
ChrsMark
merged 77 commits into
elastic:master
from
premendrasingh:openmetrics-collector
Nov 17, 2021
Merged
Changes from 75 commits
Commits
Show all changes
77 commits
Select commit
Hold shift + click to select a range
22fe440
Openmetrics support using textparser
premendrasingh a78259d
Remove created, commented code, reformat.
premendrasingh 8d16c93
Update go.mod for Azure/go-autorest
premendrasingh d5157de
Merge remote-tracking branch 'beats_upstream/master' into openmetrics…
premendrasingh d33b99b
Merge remote-tracking branch 'beats_upstream/master' into openmetrics…
premendrasingh 809126c
Merge remote-tracking branch 'beats_upstream/master' into openmetrics…
premendrasingh 5f098b8
Merge remote-tracking branch 'beats_upstream/master' into openmetrics…
premendrasingh eba0802
Merge github.com:premendrasingh/beats into openmetrics-collector
premendrasingh 9d66568
Merge remote-tracking branch 'beats_upstream/master' into openmetrics…
premendrasingh 828e75a
Merge remote-tracking branch 'beats_upstream/master' into openmetrics…
premendrasingh 9ed8773
Merge remote-tracking branch 'beats_upstream/master' into openmetrics…
premendrasingh 5c55db1
Changes based on PR review
premendrasingh 1572d2a
Merge remote-tracking branch 'beats_upstream/master' into openmetrics…
premendrasingh 6427329
Remove ; and commented code, remove import, change import to promethe…
premendrasingh 4e4ed44
Clean up go.sum. Add examples of multi metrics with Help,Type,Unit
premendrasingh be59384
Cleaned up - go mod tidy
premendrasingh cdd75fa
Added config parameters enable_exemplars, enable_metadata to control …
premendrasingh 5168fac
Merge remote-tracking branch 'beats_upstream/master' into openmetrics…
premendrasingh 1cab381
Fix test cases, clean up, config for contentType
premendrasingh 414a5f0
change prom to openMetrics
premendrasingh 1dd465f
Add test case to show same labels are collapsed when metadata and exe…
premendrasingh 2269f9d
Merge remote-tracking branch 'beats_upstream/master' into openmetrics…
premendrasingh e9ccfc6
Change go.mod, go.sum
premendrasingh 22af3f7
Remove reference to host
premendrasingh 12bf19d
Remove left over comment
premendrasingh 9aadfff
Change to uppercase
premendrasingh 5c31a66
Change to uppercase, add missing word exemplar
premendrasingh ff61542
Fix lint error for missing azure-sdk-for-go entry in go.sum
premendrasingh 7449bd7
Fix lint error for missing Azure/go-autorest/autorest entry in go.sum
premendrasingh 143cce1
Fix lint error for missing Azure/go-autorest/autorest/adal entry in g…
premendrasingh b48de01
Fix lint error for missing Azure/go-autorest/autorest/to entry in go.sum
premendrasingh a508ebf
Fix lint error for missing HdrHistogram/hdrhistogram-go to entry in g…
premendrasingh ea797f0
Merge remote-tracking branch 'beats_upstream/master' into openmetrics…
premendrasingh aa1d654
Revert "Merge remote-tracking branch 'beats_upstream/master' into ope…
premendrasingh 6906076
Fix lint error for missing HdrHistogram/hdrhistogram-go entry in go.sum
premendrasingh 651e55c
Fix lint error for missing alecthomas/units entry in go.sum
premendrasingh 2a1e9b7
Fix lint error for missing aws/aws-sdk-go entry in go.sum
premendrasingh 7951dfb
Fix lint error for missing containerd/containerd entry in go.sum
premendrasingh 94199be
Fix lint error for missing dgryski/go-sip13 entry in go.sum
premendrasingh 571e238
Fix lint error for missing digitalocean/godo entry in go.sum
premendrasingh 91ce3e2
Fix lint error for missing edsrzf/mmap-go entry in go.sum
premendrasingh 36dddcd
Fix lint error for missing go-kit/kit entry in go.sum
premendrasingh 3152943
Fix lint error for missing go-kit/log entry in go.sum
premendrasingh 57f2168
Fix lint error for missing go-logfmt/logfmt entry in go.sum
premendrasingh 35bb0d7
Fix lint error for missing go-openapi/strfmt entry in go.sum
premendrasingh 083fc29
Fix lint error for missing go-zookeeper/zk entry in go.sum
premendrasingh a9fed46
Fix lint error for missing google/pprof entry in go.sum
premendrasingh f1ddf0b
Fix lint error for missing gophercloud/gophercloud entry in go.sum
premendrasingh 9e5a0bf
Fix lint error for missing grpc-ecosystem/grpc-gateway entry in go.sum
premendrasingh 942cc62
Merge conflict
premendrasingh 8a6f791
Merge conflict
premendrasingh e9c6afd
Fix lint error for missing golang.org/x/sys entry in go.sum
premendrasingh 22f0c9c
Fix lint error for missing golang.org/x/sys entry in go.sum
premendrasingh c9b0392
Fix lint error for missing github.com/HdrHistogram/hdrhistogram-go e…
premendrasingh c6cb7a9
Fix lint error for missing github.com/prometheus/client_golang entry…
premendrasingh 9145e82
Fix lint error for missing github.com/prometheus/client_model entry …
premendrasingh e79c8c7
Fix lint error for missing github.com/prometheus/common entry in go.sum
premendrasingh d241aeb
Fix lint error for missing github.com/prometheus/procfs entry in go.sum
premendrasingh 2aa82fb
Fix lint error for missing cloud.google.com/go entry in go.sum
premendrasingh f975a80
Fix lint error for missing cloud.google.com/go/storage entry in go.sum
premendrasingh c248bf4
Fix lint error for missing github.com/golang/protobuf entry in go.sum
premendrasingh d0e4f0f
Fix merge conflict for github.com/golang/protobuf in go.sum
premendrasingh 7188df3
Fix lint error for missing github.com/google/go-cmp entry in go.sum
premendrasingh 4c3c34e
Fix merge conflict for github.com/google/go-cmp in go.sum
premendrasingh 1be887e
Fix lint error for missing go.opencensus.io entry in go.sum
premendrasingh 76aedd4
Fix merge conflict for go.opencensus.io in go.sum
premendrasingh 1915e14
Fix lint error for missing cloud.google.com/go/bigquery entry in go.sum
premendrasingh 309da12
Merge remote-tracking branch 'beats_upstream/master' into openmetrics…
premendrasingh ef6835c
Fix lint error for missing golang.org/x/net entry in go.sum
premendrasingh a46ba13
Merge remote-tracking branch 'beats_upstream/master' into openmetrics…
premendrasingh 6be21bb
Change to m.Module().Name()
premendrasingh 605a024
Merge remote-tracking branch 'beats_upstream/master' into openmetrics…
premendrasingh 4400daf
Restore go.mod
premendrasingh b80441a
do make update
premendrasingh 24ad943
Make fmt
premendrasingh 80fe40d
Review comment to change to openmetrics
premendrasingh ff107b4
make update reverted openmetrics back to host
premendrasingh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// Licensed to Elasticsearch B.V. under one or more contributor | ||
// license agreements. See the NOTICE file distributed with | ||
// this work for additional information regarding copyright | ||
// ownership. Elasticsearch B.V. licenses this file to you under | ||
// the Apache License, Version 2.0 (the "License"); you may | ||
// not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
|
||
package openmetrics | ||
|
||
// LabelMap defines the mapping from OpenMetrics label to a Metricbeat field | ||
type LabelMap interface { | ||
// GetField returns the resulting field name | ||
GetField() string | ||
|
||
// IsKey returns true if the label is a key label | ||
IsKey() bool | ||
} | ||
|
||
// Label maps a OpenMetrics label to a Metricbeat field | ||
func Label(field string) LabelMap { | ||
return &commonLabel{ | ||
field: field, | ||
key: false, | ||
} | ||
} | ||
|
||
// KeyLabel maps a OpenMetrics label to a Metricbeat field. The label is flagged as key. | ||
// Metrics with the same tuple of key labels will be grouped in the same event. | ||
func KeyLabel(field string) LabelMap { | ||
return &commonLabel{ | ||
field: field, | ||
key: true, | ||
} | ||
} | ||
|
||
type commonLabel struct { | ||
field string | ||
key bool | ||
} | ||
|
||
// GetField returns the resulting field name | ||
func (l *commonLabel) GetField() string { | ||
return l.field | ||
} | ||
|
||
// IsKey returns true if the label is a key label | ||
func (l *commonLabel) IsKey() bool { | ||
return l.key | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this accurate? What is the
host
module it refers to?