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 committed Jun 1, 2022
1 parent e6f3546 commit c135dab
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:https://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:https://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 c135dab

Please sign in to comment.