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

prototype from grafana.cloud components DO NOT MERGE #6202

Closed
wants to merge 1 commit into from

Conversation

erikbaranowski
Copy link
Contributor

THESE ARE PROTOTYPES DO NOT MERGE

DOES NOT INCLUDE:

  • well written code
  • components we definitely want to support

Notes:

  • Each component could also be implemented at the stack level instead of org level
  • grafana.cloud.instances should probably export the token too so you don't need to set it multiple places
  • grafana.cloud.receivers
    • Maybe should group the exports by receiver type rather than stack
    • Only implemented for prometheus to start
    • Component arguments could include all promtheus.remote_write args if we wanted

Usage:

Set up an access policy with a token like this
image

  • grafana.cloud.instances
grafana.cloud.instances "default" {
	token = "TOKEN"
	org   = "ORG"
}

prometheus.remote_write "default" {
	endpoint {
		url = grafana.cloud.instances.default.stacks["STACK"]["metrics_url"]

		basic_auth {
			username = grafana.cloud.instances.default.stacks["STACK"]["metrics_username"]
			password = "TOKEN"
		}
	}
}

prometheus.scrape "default" {
	targets         = [{"__address__" = "0.0.0.0:12345"}]
	forward_to      = [prometheus.remote_write.default.receiver]
	scrape_interval = "10s"
}
  • grafana.cloud.receivers
grafana.cloud.receivers "default" {
	token = "TOKEN"
	org   = "ORG"
}

prometheus.scrape "default" {
	targets         = [{"__address__" = "0.0.0.0:12345"}]
	forward_to      = [
		grafana.cloud.receivers.default.stacks["STACK1"].prometheus_receiver,
		grafana.cloud.receivers.default.stacks["STACK2"].prometheus_receiver,
	]
	scrape_interval = "10s"
}

PR Description

Which issue(s) this PR fixes

Notes to the Reviewer

PR Checklist

  • CHANGELOG.md updated
  • Documentation added
  • Tests updated
  • Config converters updated

Signed-off-by: erikbaranowski <39704712+erikbaranowski@users.noreply.github.com>
@erikbaranowski
Copy link
Contributor Author

No plans to move forward with this at this time.

@github-actions github-actions bot added the frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed. label Mar 11, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant