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

Openmetrics support using textparser #27269

Merged
merged 77 commits into from
Nov 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
22fe440
Openmetrics support using textparser
premendrasingh Aug 3, 2021
a78259d
Remove created, commented code, reformat.
premendrasingh Aug 4, 2021
8d16c93
Update go.mod for Azure/go-autorest
premendrasingh Aug 6, 2021
d5157de
Merge remote-tracking branch 'beats_upstream/master' into openmetrics…
premendrasingh Aug 6, 2021
d33b99b
Merge remote-tracking branch 'beats_upstream/master' into openmetrics…
premendrasingh Aug 11, 2021
809126c
Merge remote-tracking branch 'beats_upstream/master' into openmetrics…
premendrasingh Aug 12, 2021
5f098b8
Merge remote-tracking branch 'beats_upstream/master' into openmetrics…
premendrasingh Aug 15, 2021
eba0802
Merge github.com:premendrasingh/beats into openmetrics-collector
premendrasingh Aug 20, 2021
9d66568
Merge remote-tracking branch 'beats_upstream/master' into openmetrics…
premendrasingh Aug 20, 2021
828e75a
Merge remote-tracking branch 'beats_upstream/master' into openmetrics…
premendrasingh Aug 28, 2021
9ed8773
Merge remote-tracking branch 'beats_upstream/master' into openmetrics…
premendrasingh Sep 1, 2021
5c55db1
Changes based on PR review
premendrasingh Sep 1, 2021
1572d2a
Merge remote-tracking branch 'beats_upstream/master' into openmetrics…
premendrasingh Sep 2, 2021
6427329
Remove ; and commented code, remove import, change import to promethe…
premendrasingh Sep 2, 2021
4e4ed44
Clean up go.sum. Add examples of multi metrics with Help,Type,Unit
premendrasingh Sep 3, 2021
be59384
Cleaned up - go mod tidy
premendrasingh Sep 3, 2021
cdd75fa
Added config parameters enable_exemplars, enable_metadata to control …
premendrasingh Sep 6, 2021
5168fac
Merge remote-tracking branch 'beats_upstream/master' into openmetrics…
premendrasingh Sep 6, 2021
1cab381
Fix test cases, clean up, config for contentType
premendrasingh Sep 6, 2021
414a5f0
change prom to openMetrics
premendrasingh Sep 6, 2021
1dd465f
Add test case to show same labels are collapsed when metadata and exe…
premendrasingh Sep 7, 2021
2269f9d
Merge remote-tracking branch 'beats_upstream/master' into openmetrics…
premendrasingh Sep 7, 2021
e9ccfc6
Change go.mod, go.sum
premendrasingh Sep 9, 2021
22af3f7
Remove reference to host
premendrasingh Sep 9, 2021
12bf19d
Remove left over comment
premendrasingh Sep 9, 2021
9aadfff
Change to uppercase
premendrasingh Sep 9, 2021
5c31a66
Change to uppercase, add missing word exemplar
premendrasingh Sep 9, 2021
ff61542
Fix lint error for missing azure-sdk-for-go entry in go.sum
premendrasingh Sep 16, 2021
7449bd7
Fix lint error for missing Azure/go-autorest/autorest entry in go.sum
premendrasingh Sep 16, 2021
143cce1
Fix lint error for missing Azure/go-autorest/autorest/adal entry in g…
premendrasingh Sep 16, 2021
b48de01
Fix lint error for missing Azure/go-autorest/autorest/to entry in go.sum
premendrasingh Sep 16, 2021
a508ebf
Fix lint error for missing HdrHistogram/hdrhistogram-go to entry in g…
premendrasingh Sep 16, 2021
ea797f0
Merge remote-tracking branch 'beats_upstream/master' into openmetrics…
premendrasingh Sep 16, 2021
aa1d654
Revert "Merge remote-tracking branch 'beats_upstream/master' into ope…
premendrasingh Sep 16, 2021
6906076
Fix lint error for missing HdrHistogram/hdrhistogram-go entry in go.sum
premendrasingh Sep 17, 2021
651e55c
Fix lint error for missing alecthomas/units entry in go.sum
premendrasingh Sep 17, 2021
2a1e9b7
Fix lint error for missing aws/aws-sdk-go entry in go.sum
premendrasingh Sep 17, 2021
7951dfb
Fix lint error for missing containerd/containerd entry in go.sum
premendrasingh Sep 17, 2021
94199be
Fix lint error for missing dgryski/go-sip13 entry in go.sum
premendrasingh Sep 17, 2021
571e238
Fix lint error for missing digitalocean/godo entry in go.sum
premendrasingh Sep 17, 2021
91ce3e2
Fix lint error for missing edsrzf/mmap-go entry in go.sum
premendrasingh Sep 17, 2021
36dddcd
Fix lint error for missing go-kit/kit entry in go.sum
premendrasingh Sep 17, 2021
3152943
Fix lint error for missing go-kit/log entry in go.sum
premendrasingh Sep 17, 2021
57f2168
Fix lint error for missing go-logfmt/logfmt entry in go.sum
premendrasingh Sep 17, 2021
35bb0d7
Fix lint error for missing go-openapi/strfmt entry in go.sum
premendrasingh Sep 17, 2021
083fc29
Fix lint error for missing go-zookeeper/zk entry in go.sum
premendrasingh Sep 17, 2021
a9fed46
Fix lint error for missing google/pprof entry in go.sum
premendrasingh Sep 17, 2021
f1ddf0b
Fix lint error for missing gophercloud/gophercloud entry in go.sum
premendrasingh Sep 17, 2021
9e5a0bf
Fix lint error for missing grpc-ecosystem/grpc-gateway entry in go.sum
premendrasingh Sep 19, 2021
942cc62
Merge conflict
premendrasingh Sep 19, 2021
8a6f791
Merge conflict
premendrasingh Sep 19, 2021
e9c6afd
Fix lint error for missing golang.org/x/sys entry in go.sum
premendrasingh Sep 19, 2021
22f0c9c
Fix lint error for missing golang.org/x/sys entry in go.sum
premendrasingh Sep 19, 2021
c9b0392
Fix lint error for missing github.com/HdrHistogram/hdrhistogram-go e…
premendrasingh Sep 19, 2021
c6cb7a9
Fix lint error for missing github.com/prometheus/client_golang entry…
premendrasingh Sep 19, 2021
9145e82
Fix lint error for missing github.com/prometheus/client_model entry …
premendrasingh Sep 19, 2021
e79c8c7
Fix lint error for missing github.com/prometheus/common entry in go.sum
premendrasingh Sep 19, 2021
d241aeb
Fix lint error for missing github.com/prometheus/procfs entry in go.sum
premendrasingh Sep 19, 2021
2aa82fb
Fix lint error for missing cloud.google.com/go entry in go.sum
premendrasingh Sep 20, 2021
f975a80
Fix lint error for missing cloud.google.com/go/storage entry in go.sum
premendrasingh Sep 20, 2021
c248bf4
Fix lint error for missing github.com/golang/protobuf entry in go.sum
premendrasingh Sep 20, 2021
d0e4f0f
Fix merge conflict for github.com/golang/protobuf in go.sum
premendrasingh Sep 20, 2021
7188df3
Fix lint error for missing github.com/google/go-cmp entry in go.sum
premendrasingh Sep 20, 2021
4c3c34e
Fix merge conflict for github.com/google/go-cmp in go.sum
premendrasingh Sep 20, 2021
1be887e
Fix lint error for missing go.opencensus.io entry in go.sum
premendrasingh Sep 20, 2021
76aedd4
Fix merge conflict for go.opencensus.io in go.sum
premendrasingh Sep 20, 2021
1915e14
Fix lint error for missing cloud.google.com/go/bigquery entry in go.sum
premendrasingh Sep 20, 2021
309da12
Merge remote-tracking branch 'beats_upstream/master' into openmetrics…
premendrasingh Sep 20, 2021
ef6835c
Fix lint error for missing golang.org/x/net entry in go.sum
premendrasingh Sep 21, 2021
a46ba13
Merge remote-tracking branch 'beats_upstream/master' into openmetrics…
premendrasingh Sep 21, 2021
6be21bb
Change to m.Module().Name()
premendrasingh Oct 13, 2021
605a024
Merge remote-tracking branch 'beats_upstream/master' into openmetrics…
premendrasingh Nov 14, 2021
4400daf
Restore go.mod
premendrasingh Nov 14, 2021
b80441a
do make update
premendrasingh Nov 15, 2021
24ad943
Make fmt
premendrasingh Nov 15, 2021
80fe40d
Review comment to change to openmetrics
premendrasingh Nov 16, 2021
ff107b4
make update reverted openmetrics back to host
premendrasingh Nov 16, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 52 additions & 2 deletions metricbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -52790,10 +52790,40 @@ Openmetrics module



*`openmetrics.help`*::
+
--
Brief description of the MetricFamily


type: keyword

--

*`openmetrics.type`*::
+
--
Metric type


type: keyword

--

*`openmetrics.unit`*::
+
--
Metric unit


type: keyword

--

*`openmetrics.labels.*`*::
+
--
Prometheus metric labels
Openmetrics metric labels


type: object
Expand All @@ -52803,7 +52833,27 @@ type: object
*`openmetrics.metrics.*`*::
+
--
Prometheus metric
Openmetrics metric


type: object

--

*`openmetrics.exemplar.*`*::
+
--
Openmetrics exemplars


type: object

--

*`openmetrics.exemplar.labels.*`*::
+
--
Openmetrics metric exemplar labels


type: object
Expand Down
1 change: 1 addition & 0 deletions metricbeat/docs/modules/openmetrics/collector.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ beta[]

include::../../../module/openmetrics/collector/_meta/docs.asciidoc[]

This is a default metricset. If the host module is unconfigured, this metricset is enabled by default.
Copy link
Member

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?

ChrsMark marked this conversation as resolved.
Show resolved Hide resolved

==== Fields

Expand Down
59 changes: 59 additions & 0 deletions metricbeat/helper/openmetrics/label.go
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
}
Loading