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 container names to match the ones expected by cortex-mixin #233

Conversation

danfromtitan
Copy link
Contributor

@danfromtitan danfromtitan commented Oct 4, 2021

What this PR does:
All Cortex container names take the Chart.Name value, making it impossible to query metrics based on container metric label. On top of that, the cortex-mixin configuration looks for specific names. The change aligns the container names with their functionality.

Which issue(s) this PR fixes:
Fixes #233

Checklist

  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Dan Constantinescu added 2 commits October 4, 2021 13:30
@danfromtitan danfromtitan force-pushed the enhancement/container-names-match-cortex-mixin branch from 3f0bd0c to 35e6377 Compare October 4, 2021 17:30
templates/nginx/nginx-dep.yaml Outdated Show resolved Hide resolved
Signed-off-by: Dan Constantinescu <[email protected]>
@danfromtitan danfromtitan force-pushed the enhancement/container-names-match-cortex-mixin branch from 2bbe002 to 5cd731d Compare October 4, 2021 17:44
@nschad
Copy link
Collaborator

nschad commented Oct 4, 2021

LGTM

@nschad nschad requested a review from kd7lxl October 4, 2021 18:02
@nschad
Copy link
Collaborator

nschad commented Oct 4, 2021

Hey @danfromtitan,

I use the mixin as well. I can share my config in order to get it working. I use some relabel config to add the cluster part/label and slighty adjusted job labels. I did not have to rename containers, that really doesn't make super much sense too me either

Soo..

distributor:
  service:
    labels:
      cluster: my-cluster
  serviceMonitor:
    enabled: true
    relabelings:
      - sourceLabels: [__meta_kubernetes_service_label_cluster]
        regex: (.*)
        replacement: $1
        targetLabel: cluster
        action: replace
      - sourceLabels: [__meta_kubernetes_namespace, __meta_kubernetes_service_label_app_kubernetes_io_component]
        targetLabel: job
        separator: "/"

And as job_names I have just

     job_names: {
      ingester: 'ingester',  // Match also ingester-blocks, which is used during the migration from chunks to blocks.
      distributor: 'distributor',

@danfromtitan
Copy link
Contributor Author

I can share my config in order to get it working

Thanks for sharing, I was looking for this relabeling detail earlier, I think it would reduce the amount of changes required in cortex-mixin fork but it would still need container to have the component in the name for the reasons mentioned above.

@nschad
Copy link
Collaborator

nschad commented Oct 4, 2021

I can share my config in order to get it working

Thanks for sharing, I was looking for this relabeling detail earlier, I think it would reduce the amount of changes required in cortex-mixin fork but it would still need container to have the component in the name for the reasons mentioned above.

Yep I agree. I also didn't check every dashboard, so there still might be some problems. I feel like this is a bit out of scope but maybe we can figure something out. Thanks for raising the Issue

@kd7lxl
Copy link
Collaborator

kd7lxl commented Oct 14, 2021

Have you tested the relabeling with/without the container name change? It's still unclear whether this change is proven useful or just something you wanted to test.

@danfromtitan
Copy link
Contributor Author

I did, the relabelling helps whenever a namespace/job value comes into play, but container labels are hard coded as I mentioned above.

Besides the relabelling and the container names change in the chart, you can see here the additional changes required to get all dashboards fully functional.

@nschad
Copy link
Collaborator

nschad commented Nov 5, 2021

I did, the relabelling helps whenever a namespace/job value comes into play, but container labels are hard coded as I mentioned above.

Besides the relabelling and the container names change in the chart, you can see here the additional changes required to get all dashboards fully functional.

Have you created a PR over at cortex-jsonnet to be more dynamic with the mixin?

@danfromtitan
Copy link
Contributor Author

Have you created a PR over at cortex-jsonnet to be more dynamic with the mixin?

That was my next target, but I cannot test the changes there unless this PR is merged first.

@nschad
Copy link
Collaborator

nschad commented Nov 9, 2021

Have you created a PR over at cortex-jsonnet to be more dynamic with the mixin?

That was my next target, but I cannot test the changes there unless this PR is merged first.

Excuse my ignorance but why? Which dashboards require a change here? I don't really get it

@danfromtitan
Copy link
Contributor Author

Excuse my ignorance but why? Which dashboards require a change here? I don't really get it

Please see in my comment above.

@nschad
Copy link
Collaborator

nschad commented Nov 9, 2021

Excuse my ignorance but why? Which dashboards require a change here? I don't really get it

Please see in my comment above.

Gotcha! I will talk to @kd7lxl

@kd7lxl
Copy link
Collaborator

kd7lxl commented Nov 9, 2021

I'm a little puzzled by the conversation here.

I cannot test the changes there unless this PR is merged first.

This doesn't make any sense to me. You can helm install from your branch just as easily as you can helm install from the master branch or a release.

Please test the desired dashboard behavior against this branch to prove that it solves the problem. Please share your results.

If everything works as expected, we can target this for v1.0.0. It will need to be in a major version release because it's a breaking change -- everyone who has dashboards targeting the current container names will need to rewrite their dashboards.

@danfromtitan
Copy link
Contributor Author

everyone who has dashboards targeting the current container names will need to rewrite their dashboards

In case someone's using cortex-mixin to create dashboards, they will need the same change I requested in this PR.

Anyone else using container label in their dashboards would look at misleading results, because container label "cortex" would query the metrics from all components instead of the specific component dashboard is intended for.

I have made changes to the cortex-mixin project that are waiting to be merged, dahboards work perfectly, we need this PR merged first before I can submit the other.

@nschad
Copy link
Collaborator

nschad commented Nov 10, 2021

everyone who has dashboards targeting the current container names will need to rewrite their dashboards

In case someone's using cortex-mixin to create dashboards, they will need the same change I requested in this PR.

Anyone else using container label in their dashboards would look at misleading results, because container label "cortex" would query the metrics from all components instead of the specific component dashboard is intended for.

I have made changes to the cortex-mixin project that are waiting to be merged, dahboards work perfectly, we need this PR merged first before I can submit the other.

That's fine by me. We can release that with version 1.0.0

@nschad nschad merged commit af6a525 into cortexproject:master Nov 17, 2021
@danfromtitan danfromtitan deleted the enhancement/container-names-match-cortex-mixin branch December 1, 2021 02:34
@nschad
Copy link
Collaborator

nschad commented Dec 3, 2021

@danfromtitan have you opened up a PR with the folks over at grafana?

@danfromtitan
Copy link
Contributor Author

Not yet, it's on my list. Thanks for merging this.

@danfromtitan
Copy link
Contributor Author

@danfromtitan have you opened up a PR with the folks over at grafana?

Thanks for accepting this PR, I opened grafana/cortex-jsonnet#427 to fix the outstanding issues with Grafana dashboards when Cortex is deployed from the Helm chart.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants