janus-idp / backstage-showcase

Enterprise-ready Backstage distribution
https://showcase.janus-idp.io
Apache License 2.0
102 stars 138 forks source link

Wrong label and container port in doc on Setting up Metrics Monitoring for Operator-backed deployments #1321

Closed rm3l closed 1 week ago

rm3l commented 3 weeks ago

What do you want to improve?

https://github.com/janus-idp/backstage-showcase/blob/main/showcase-docs/monitoring-and-logging.md#operator-backed-deployment

Stumbled upon this while reviewing https://github.com/redhat-developer/red-hat-developers-documentation-rhdh/pull/263

What is the current documentation?

# make sure to update CR_NAME value accordingly
$ CR_NAME=my-rhdh
$ MY_PROJECT=my-project
$ cat <<EOF > /tmp/${CR_NAME}.ServiceMonitor.yaml
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  name: ${CR_NAME}
  namespace: ${MY_PROJECT}
  labels:
    app.kubernetes.io/instance: ${CR_NAME}
    app.kubernetes.io/name: backstage
spec:
  namespaceSelector:
    matchNames:
      - ${MY_PROJECT}
  selector:
    matchLabels:
      janus-idp.io/app: backstage-${CR_NAME}
  endpoints:
  - port: http-backend
    path: '/metrics'
EOF
$ oc apply -f /tmp/${CR_NAME}.ServiceMonitor.yaml

In the ServiceMonitor resource to create, the label name added by the Operator has changed from janus-idp.io/app to rhdh.redhat.com/app a long time ago (https://github.com/janus-idp/operator/issues/199) before the first version of the operator was released, and we forgot to update this doc.

Also, the container port endpoint to scrape metrics from seems to be wrong. It should be backend as per the 1.1.x, 1.2.x or main branches in the operator repo.

As a consequence, the instructions depicted in this https://github.com/janus-idp/backstage-showcase/blob/main/showcase-docs/monitoring-and-logging.md#operator-backed-deployment will not work as expected.

What is the new documentation?

/good-first-issue

JIRA: https://issues.redhat.com/browse/RHIDP-2657

openshift-ci[bot] commented 3 weeks ago

@rm3l: This request has been marked as suitable for new contributors.

Please ensure the request meets the requirements listed here.

If this request no longer meets these requirements, the label can be removed by commenting with the /remove-good-first-issue command.

In response to [this](https://github.com/janus-idp/backstage-showcase/issues/1321): >### What do you want to improve? > >https://github.com/janus-idp/backstage-showcase/blob/main/showcase-docs/monitoring-and-logging.md#operator-backed-deployment > >### What is the current documentation? > >In the `ServiceMonitor` resource to create, the label name added by the Operator has changed from `janus-idp.io/app` to `rhdh.redhat.com/app` a long time ago (https://github.com/janus-idp/operator/issues/199) before the first version of the operator was released, and we forgot to update this doc. > >Also, the container port endpoint to scrape metrics from seems to be wrong. It should be `backend` as per the [`1.1.x`](https://github.com/janus-idp/operator/blob/1.1.x/config/manager/default-config/deployment.yaml?rgh-link-date=2024-06-12T13%3A16%3A38Z#L88), [`1.2.x`](https://github.com/janus-idp/operator/blob/1.2.x/config/manager/default-config/deployment.yaml?rgh-link-date=2024-06-12T13%3A16%3A38Z#L97) or [`main`](https://github.com/janus-idp/operator/blob/main/config/manager/default-config/deployment.yaml#L97) branches in the operator repo. > >As a consequence, the instructions depicted in this https://github.com/janus-idp/backstage-showcase/blob/main/showcase-docs/monitoring-and-logging.md#operator-backed-deployment will not work as expected. > >### What is the new documentation? > >- Replace `janus-idp.io/app` with `rhdh.redhat.com/app` >- Replace the container port name from `http-backend` to `backend` >- Make sure the instructions provided work correctly > >/good-first-issue Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
Fortune-Ndlovu commented 2 weeks ago

The relevant updates have been made for this issue and I have also opened up the PR: https://github.com/janus-idp/backstage-showcase/pull/1332.

rm3l commented 1 week ago

Fixed by https://github.com/janus-idp/backstage-showcase/pull/1332

/close

openshift-ci[bot] commented 1 week ago

@rm3l: Closing this issue.

In response to [this](https://github.com/janus-idp/backstage-showcase/issues/1321#issuecomment-2193993434): >Fixed by https://github.com/janus-idp/backstage-showcase/pull/1332 > >/close Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.