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

*: Update docs with latest Telemeter architecture #430

Merged
merged 4 commits into from
Sep 8, 2022

Conversation

saswatamcode
Copy link
Member

@saswatamcode saswatamcode commented Aug 29, 2022

This PR updates the README with the latest Telemeter architecture and operational paths, along with a diagram.
Feel free to correct me if I am wrong somewhere, as this is not a super familiar path. 🙂

Rendered here: https://github.com/saswatamcode/telemeter/blob/docs/README.md

Also, will add mdox for docs check purposes once in #428 once this is merged!

Signed-off-by: Saswata Mukherjee <[email protected]>
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Signed-off-by: Saswata Mukherjee <[email protected]>
Copy link
Contributor

@JoaoBraveCoding JoaoBraveCoding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job! I also knew very little of this side of things but now it's clearer! Thank you!

README.md Outdated Show resolved Hide resolved
2. This handler uses [`tollbooth.NewAuthorizer`](https://github.com/openshift/telemeter/blob/master/pkg/authorize/tollbooth/tollbooth.go) which implements the [`authorize.ClusterAuthorizer`](https://github.com/openshift/telemeter/blob/master/pkg/authorize/cluster.go) interface, to authorize that particular cluster. It uses [`authorize.AgainstEndpoint`](https://github.com/openshift/telemeter/blob/a30ef1e07eb12468cdcbdcf6fde45469a9fa5d60/pkg/authorize/handler.go#L65) to send the cluster ID and token as a POST request to the authorization server (configured via `--authorize`). The authorization server returns a 200 status code, if the cluster is identified correctly.
3. `tollbooth.AuthorizeCluster` returns a subject which is used as the client identifier in a generated signed JWT which is returned to the telemeter-client, along with any labels.

## /metrics/v1/receive endpoint (receive metrics in prompb.WriteRequest format from any client)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no mention but I'm guessing that here we also check if the prometheus is not going over the rate-limiting for the ID of the cluster

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, does the whole maintaining timestamp drift also happen on this endpoint?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So regarding rate limiting requests based on cluster ID, I don't think we do it for metrics/v1/receive currently as per the handler https://github.com/openshift/telemeter/blob/master/cmd/telemeter-server/main.go#L528. This route isn't really used at the moment, except by perhaps Hypershift.

And we do not modify the timestamps in the Prometheus remote write request in any way. We only drop certain timeseries in the request or drop labels. 🙂

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK perfect! I just mentioned it in case you wanted to mention it on the doc! 👌

Signed-off-by: Saswata Mukherjee <[email protected]>
Copy link
Contributor

@JoaoBraveCoding JoaoBraveCoding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look good to me 💯 Not adding lgmt right away in case @saswatamcode wants the input of more members of the team, otherwise, I'm happy to add it

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 29, 2022
@saswatamcode
Copy link
Member Author

/retest

Copy link
Contributor

@philipgough philipgough left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@philipgough
Copy link
Contributor

/test e2e-aws-ovn

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 8, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 8, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JoaoBraveCoding, PhilipGough, saswatamcode

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [JoaoBraveCoding,PhilipGough]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD a30ef1e and 2 for PR HEAD e549ae2 in total

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 8, 2022

@saswatamcode: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@openshift-merge-robot openshift-merge-robot merged commit 320b9a9 into openshift:master Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants