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

Implement Cloud Foundry metrics receiver #5320

Closed
agoallikmaa opened this issue Sep 21, 2021 · 1 comment
Closed

Implement Cloud Foundry metrics receiver #5320

agoallikmaa opened this issue Sep 21, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@agoallikmaa
Copy link
Contributor

Is your feature request related to a problem? Please describe.
There is currently no receiver to consume metrics published from Cloud Foundry (and therefore also Tanzu Application Service).

Describe the solution you'd like
Cloud Foundry publishes its metrics through its RLP (Reverse Log Proxy) Gateway, which exposes an HTTP endpoint that accepts an OAuth token for authentication. The token can be received from the Cloud Foundry UAA component, which produces a token if given the username and password that was created with the authority to access logs.

The proposed solution is to have the receiver fetch the token via UAA and then connect to the RLP Gateway to receive metrics. There are existing libraries to access both UAA and RLP Gateway which can be used (github.com/cloudfoundry-incubator/uaago and code.cloudfoundry.org/go-loggregator/rpc/loggregator_v2 respectively). The metrics would be created under the instrumentation library named otelcol/cloudfoundry and their name would be the origin (name of Cloud Foundry system component which creates this metric) prepended to the Cloud Foundry internal metric name - as each component is responsible for different metrics, this does not increase cardinality, but does make it more clear what the metric relates to. All metrics of counter and gauge types provided by Cloud Foundry would be reported with all tags kept as labels, with no filtering.

Describe alternatives you've considered
Currently the only alternative that could be immediately used is to use another agent as a proxy which already implements a Cloud Foundry receiver and can export metrics in a format that the collector already supports. However, this is not an optimal setup as it would be best to be able to monitor services with only OpenTelemetry collector and/or agents. Similarly, it is not optimal to have a new standalone component intended for passing these metrics to an existing receiver, as that would also add additional complexity when an endpoint that could be directly accessed by the collector already exists.

The stage one PR for this: #4626

tigrannajaryan pushed a commit that referenced this issue Sep 21, 2021
Adds a Cloud Foundry metric receiver which reads metrics from Cloud Foundry Reverse Log Proxy Gateway. More details available in the `README.md`. `make gotidy` seems to have made plenty of subtle changes to `go.sum` files, not sure if this is normal. This PR contains the overall structure, documentation, implementation for config and factory, but does NOT contain the implementation of the receiver and does not enable the component, as that will come in separate PRs later.

**Link to tracking Issue:** #5320

**Testing:** Unit tests. Manual testing was performed against Tanzu Application Service (TAS) versions 2.7, 2.8 and 2.11. Considered adding an integration test with mocked HTTP servers acting as endpoints where the HTTP server would provide a constant response (prerecorded from the real TAS traffic), but not sure if mocks would make more sense.

**Documentation:** `README.md` and `doc.go` for the new receiver module were added.
@alolita alolita added the enhancement New feature or request label Sep 30, 2021
@pellared
Copy link
Member

Nice to address: #5543 (comment)

tigrannajaryan pushed a commit that referenced this issue Nov 19, 2021
Adds implementation to the Cloud Foundry receiver skeleton merged in #4626 .

**Link to tracking Issue:** #5320

**Testing:** Some implementation parts have been unit tested, the rest will be added as integration tests, in a separate PR which tests against a local HTTP server which will respond with prerecorded responses (recorded from running it against Tanzu Application Service).

**Documentation:** Configuration was updated in documentation to reflect using `HTTPClientSettings` instead of custom fields.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants