Skip to content

Commit

Permalink
[receiver/Flinkmetricsreceiver] Apache Flink Metric Receiver (open-te…
Browse files Browse the repository at this point in the history
…lemetry#10121)

* wip before integration and concurrency

* tidy up client names

* wip integration test

* wip integration test

* update to flinkmetrics and integration test

* move attributes to resource attributes

* add flink integration files

* update model import name

* add changelog and tidy up

* update mod and lint check

* update with pr feedback

* update pr feedback with status header

* unexport process methods

* go tidy up

* add partial metrics collecting on taskmanager, jobs, and subtasks

* go tidy update

* fix shadow declaration of err

* update pr feedback

* tidy up

* apply scope version update

* make expected responses easier to test when metadata/generated files update

* update to host.name and move status table

* combine jobmanager and taskmanager metrics

* tidy up

* update generated files

* fix mod version

* update pr feedback

* tidy up

* seperated checkpoint in_progress as non-monotonic sum metric

* tidy up local receiver

* update version

* update cpu descriptions

* fix taskmanager/jobs bug and added tests with multiple taskmanagers/jobs

* space

* change non_heap to nonheap

* update unit
  • Loading branch information
JonathanWamsley authored and kentquirk committed Jun 13, 2022
1 parent 1c30920 commit 1cf0631
Show file tree
Hide file tree
Showing 56 changed files with 14,718 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ receiver/dotnetdiagnosticsreceiver/ @open-telemetry/collector-c
receiver/elasticsearchreceiver/ @open-telemetry/collector-contrib-approvers @djaglowski @binaryfissiongames
receiver/expvarreceiver/ @open-telemetry/collector-contrib-approvers @jamesmoessis @MovieStoreGuy
receiver/filelogreceiver/ @open-telemetry/collector-contrib-approvers @djaglowski
receiver/flinkmetricsreceiver/ @open-telemetry/collector-contrib-approvers @jonathanwamsley @djaglowski
receiver/fluentforwardreceiver/ @open-telemetry/collector-contrib-approvers @dmitryax
receiver/googlecloudpubsubreceiver/ @open-telemetry/collector-contrib-approvers @alexvanboxel
receiver/googlecloudspannerreceiver/ @open-telemetry/collector-contrib-approvers @ydrozhdzhal @asukhyy @khospodarysko @architjugran
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@

- `jmxreceiver`: Remove properties & groovyscript parameters from JMX Receiver. Add ResourceAttributes & LogLevel parameter to supply some of the removed functionality with reduced attack surface (#9685)
- `resourcedetectionprocessor`: 'gke' and 'gce' resource detectors are replaced with a single 'gcp' detector (#10347)

- `pkg/stanza`: Removed reference to deprecated `ClusterName` (#10426)
- `couchbasereceiver`: Fully removed unimplemented Couchbase receiver (#10482)

### 🚩 Deprecations 🚩


### 🚀 New components 🚀

- `flinkmetricsreceiver`: Add implementation of Flink Metric Receiver (#10121)
- `windowseventlogreceiver` Added implementation of Windows Event Log Receiver (#9228)
- `vcenterreceiver`: Add metrics receiver for new vcenterreceiver component (#9224)

Expand Down
3 changes: 3 additions & 0 deletions cmd/configschema/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ require (
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/dotnetdiagnosticsreceiver v0.52.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/elasticsearchreceiver v0.52.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.52.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/flinkmetricsreceiver v0.0.0-00010101000000-000000000000 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/fluentforwardreceiver v0.52.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/googlecloudspannerreceiver v0.52.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver v0.52.0 // indirect
Expand Down Expand Up @@ -761,6 +762,8 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/elast

replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver => ../../receiver/filelogreceiver

replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/flinkmetricsreceiver => ../../receiver/flinkmetricsreceiver

replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/fluentforwardreceiver => ../../receiver/fluentforwardreceiver

replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/googlecloudpubsubreceiver => ../../receiver/googlecloudpubsubreceiver
Expand Down
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ require (
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/dotnetdiagnosticsreceiver v0.52.0
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/elasticsearchreceiver v0.52.0
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.52.0
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/flinkmetricsreceiver v0.0.0-00010101000000-000000000000
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/fluentforwardreceiver v0.52.0
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/googlecloudspannerreceiver v0.52.0
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver v0.52.0
Expand Down Expand Up @@ -757,6 +758,8 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/colle

replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/couchdbreceiver => ./receiver/couchdbreceiver

replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/flinkmetricsreceiver => ./receiver/flinkmetricsreceiver

replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/dockerstatsreceiver => ./receiver/dockerstatsreceiver

replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/dotnetdiagnosticsreceiver => ./receiver/dotnetdiagnosticsreceiver
Expand Down
2 changes: 2 additions & 0 deletions internal/components/components.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ import (
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/dotnetdiagnosticsreceiver"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/elasticsearchreceiver"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/flinkmetricsreceiver"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/fluentforwardreceiver"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/googlecloudspannerreceiver"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver"
Expand Down Expand Up @@ -204,6 +205,7 @@ func Components() (component.Factories, error) {
dotnetdiagnosticsreceiver.NewFactory(),
elasticsearchreceiver.NewFactory(),
filelogreceiver.NewFactory(),
flinkmetricsreceiver.NewFactory(),
fluentforwardreceiver.NewFactory(),
googlecloudspannerreceiver.NewFactory(),
hostmetricsreceiver.NewFactory(),
Expand Down
3 changes: 3 additions & 0 deletions internal/components/receivers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ func TestDefaultReceivers(t *testing.T) {
return cfg
},
},
{
receiver: "flinkmetrics",
},
{
receiver: "fluentforward",
},
Expand Down
1 change: 1 addition & 0 deletions receiver/flinkmetricsreceiver/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ../../Makefile.Common
43 changes: 43 additions & 0 deletions receiver/flinkmetricsreceiver/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# FlinkMetrics Receiver

| Status | |
| ------------------------ | --------- |
| Stability | [alpha] |
| Supported pipeline types | metrics |
| Distributions | [contrib] |

This receiver uses Flink's [REST API](https://nightlies.apache.org/flink/flink-docs-release-1.14/docs/ops/metrics/#rest-api-integration) to collect Jobmanager, Taskmanager, Job, Task and Operator metrics.

## Prerequisites

This receiver supports Apache Flink versions `1.13.6` and `1.14.4`.

By default, authentication is not required. However, [Flink recommends](https://nightlies.apache.org/flink/flink-docs-master/docs/deployment/security/security-ssl/#external--rest-connectivity) using a “side car proxy” that Binds the REST endpoint to the loopback interface and to start a REST proxy that authenticates and forwards the request to Flink.

[SSL](https://nightlies.apache.org/flink/flink-docs-master/docs/deployment/security/security-ssl/#external--rest-connectivity) can be enabled with the following REST endpoint [options](https://nightlies.apache.org/flink/flink-docs-master/docs/deployment/security/security-ssl/#rest-endpoints-external-connectivity) for external connectivity and have a self signed certificate or be self signed.

## Configuration

The following settings are optional:

- `endpoint` (default: `http://localhost:15672`): The URL of the node to be monitored.
- `collection_interval` (default = `10s`): This receiver collects metrics on an interval. Valid time units are `ns`, `us` (or `µs`), `ms`, `s`, `m`, `h`.
- `tls` (defaults defined [here](https://github.com/open-telemetry/opentelemetry-collector/blob/main/config/configtls/README.md)): TLS control. By default insecure settings are rejected and certificate verification is on.

### Example Configuration

```yaml
receivers:
flinkmetrics:
endpoint: http://localhost:8081
collection_interval: 10s
```
The full list of settings exposed for this receiver are documented [here](./config.go) with detailed sample configurations [here](./testdata/config.yaml). TLS config is documented further under the [opentelemetry collector's configtls package](https://github.com/open-telemetry/opentelemetry-collector/blob/main/config/configtls/README.md).
## Metrics
Details about the metrics produced by this receiver can be found in [metadata.yaml](./metadata.yaml)
[alpha]: https://github.com/open-telemetry/opentelemetry-collector-contrib#alpha
[contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib
Loading

0 comments on commit 1cf0631

Please sign in to comment.