-
Notifications
You must be signed in to change notification settings - Fork 0
Create initial exporter #2
base: master
Are you sure you want to change the base?
Conversation
At the moment, this is a simplified program that fetches agent pools once and exports the metrics to stdout. Example output from a local run: [
{
"Name": "agents{service.name=unknown_service:terraform-cloud-metrics-exporter,telemetry.sdk.language=go,telemetry.sdk.name=opentelemetry,telemetry.sdk.version=1.7.0,instrumentation.name=terraform_cloud,pool=default,status=idle}",
"Last": 2,
"Timestamp": "2022-05-12T16:07:56.779199-07:00"
},
{
"Name": "agents{service.name=unknown_service:terraform-cloud-metrics-exporter,telemetry.sdk.language=go,telemetry.sdk.name=opentelemetry,telemetry.sdk.version=1.7.0,instrumentation.name=terraform_cloud,pool=default,status=exited}",
"Last": 18,
"Timestamp": "2022-05-12T16:07:56.779202-07:00"
}
] A working initial version would have:
With those two things in place as well as some general refactoring/restructuring (e.g. adding CLI flags, splitting into packages) I should be able to move on to deploy. Probably another 1-2 days work here. |
Re permissions needed to fetch this data, I've observed:
An org token seems to be our best near term choice. While still fairly privileged to perform write operations, it's certainly less privileged than an owners token: https://www.terraform.io/cloud-docs/users-teams-organizations/api-tokens |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hope you don't mind a few go-specific questions! The logic for counting agents makes sense to me.
Creates the initial version of the exporter
https://takescoop.atlassian.net/browse/PLATFORM-2413