GithubHelp home page GithubHelp logo

Comments (10)

mateusoliveira43 avatar mateusoliveira43 commented on June 12, 2024

Hello @jkmattatall , thanks for using Pelorus 😄

From your configurations 2 points call my attention

  • source_url and source_ref are used for development, unless you want to deploy your own Pelorus (create a fork in your Gitea instance), I would unset those
  • I think some configuration options are with wrong name. Here is the list for committime

Can you try using this yaml and this secret?

      - app_name: committime-exporter
        enabled: true
        env_from_secrets:
          - gitea-secret
        exporter_type: committime
        extraEnv:
          - name: GIT_PROVIDER
            value: gitea
          - name: LOG_LEVEL
            value: DEBUG
oc create secret generic gitea-secret -n pelorus \
--from-literal=API_USER=<username> \
--from-literal=TOKEN=<full access token> \
--from-literal=GIT_API=<https://this.is.my.internal.gitea.link.net/organization/repository.git>

from pelorus.

jkmattatall avatar jkmattatall commented on June 12, 2024

Hi @mateusoliveira43! Thanks so much for the swift response. This appears to have worked, I now have committime/deploytime exporter pods set up and running, however I don't seem to be able to see any changes in Grafana when commits are made in the main branch in the repository. In Grafana I see these under Pelorus:

  • Software Delivery Performance, everything here says N/A
  • Software Delivery Performance - By App, Deployment Frequency > Current interval displays 1 for a few minutes on start, and then returns to N/A, after some more time the Application selector at the top can no longer select committime/deploytime

How would I test that the exporters are properly connected and see changes in Grafana?

from pelorus.

mateusoliveira43 avatar mateusoliveira43 commented on June 12, 2024

I think is everything working then. Probably grafana filter was last 5 minutes when you saw, then after this time, there were no new commits to show (check now selecting a big interval, like last 2 days, the 1 commit should show there).

I suggest you read through this to understand the measures https://pelorus.readthedocs.io/en/latest/GettingStarted/QuickstartTutorial/ its an example using GitHub and GitHub issues, but you could modify the configuration options to test with Gitea

from pelorus.

jkmattatall avatar jkmattatall commented on June 12, 2024

Thank you for the assistance again! I'm a Pelorus/metrics newbie so forgive my questions. It seems as though with just the Pelorus OpenShift Operator and the link to Gitea that it is not displaying any metrics. To me it looks like committime/deploytime in the Quickstart Tutorial you linked requires the project to be deployed in a namespace, and doesn't specifically have a link to the GitHub repository (besides the repo being what is deployed).

In your first comment:

Can you try using this yaml and this secret?

      - app_name: committime-exporter
        enabled: true
        env_from_secrets:
          - gitea-secret
        exporter_type: committime
        extraEnv:
          - name: GIT_PROVIDER
            value: gitea
          - name: LOG_LEVEL
            value: DEBUG
oc create secret generic gitea-secret -n pelorus \
--from-literal=API_USER=<username> \
--from-literal=TOKEN=<full access token> \
--from-literal=GIT_API=<https://this.is.my.internal.gitea.link.net/organization/repository.git>

There seems to be a link to the Gitea repo itself and not a deployed instance. Is this supposed to be strictly a link to an undeployed Gitea repository and not a deployed instance? If so, are metrics supposed to be gotten using committime/deploytime from just changes to a repo branch? If not, why does giving the exporters the Gitea repo matter?

from pelorus.

jkmattatall avatar jkmattatall commented on June 12, 2024

@mateusoliveira43 Hi again! I've come to the conclusion that I likely need a Gitea link and a deployed instance of something in that link in OpenShift in order to display statistics in Pelorus. So now I have a very basic Gitea repository with a folder and a basic deployable nginx yaml in it. My issue is that it's still not displaying in Grafana, I can't select anything on the top left drop-down despite there being a deployed a running nginx pod in the nginx namespace, and no statistics are displayed (even if I select a very long time range on the top right).

I deploy the nginx yaml in the exact same way as the Quickstart Tutorial, using git clone and then oc create. Below is my nginx.yaml:

apiVersion: v1
kind: Pod
metadata:
  labels:
    run: nginx
    app.kubernetes.io/name: nginx
  name: nginx
  namespace: nginx
spec:
  containers:
    - image: nginx
      name: nginx
      resources: {}
  source:
    type: Git
    git:
      uri: https://this.is.my.internal.gitea.link.net/organization/repository.git
      ref: main

Here's the exporters section of my Pelorus Operator yaml:

  exporters:
    global: {}
    instances:
      - app_name: deploytime-exporter
        enabled: true
        env_from_secrets:
          - gitea-secret
        exporter_type: deploytime
        extraEnv:
          - name: GIT_PROVIDER
            value: gitea
          - name: LOG_LEVEL
            value: DEBUG
          - name: NAMESPACES
            value: nginx
      - app_name: committime-exporter
        enabled: true
        env_from_secrets:
          - gitea-secret
        exporter_type: committime
        extraEnv:
          - name: GIT_PROVIDER
            value: gitea
          - name: LOG_LEVEL
            value: DEBUG
          - name: NAMESPACES
            value: nginx

My gitea-secret is what you recommended above with API_USER/TOKEN/GIT_API, and I've confirmed those are correct. Do you have any ideas why it may not be recognizing my nginx pod in the nginx namespace?

from pelorus.

mateusoliveira43 avatar mateusoliveira43 commented on June 12, 2024

sorry for the late response @jkmattatall , I been busy with other projects

Yeah, you need deploytime/committime to see the two first metrics

I think just Pod will not work to Pelorus to see it as deployment (@mpryc @etsauer @KevinMGranger am I right?)

I would suggest forking the sample application from quickstart tutorial in your Gitea instance

from pelorus.

jkmattatall avatar jkmattatall commented on June 12, 2024

@mateusoliveira43 no need to apologize, I appreciate any and all assistance and the free time you're giving to respond!

The big issue is that I cannot use the example demo application from the Quick Start guide since my internal system does not allow external GitHub links, as much as I may want to follow the guide, everything has to be entirely internal. Is there a way to create a very simple/small app (such as a base nginx app/pod) that has no external links which Pelorus can easily recognize?

I've also noticed that if I leave NAMESPACES unassigned, or assign it to my Pelorus namespace, that I am able to select the deployed exporters from the drop down on the top left shown here: link
I am confused as to what the discrepancy is between the Pelorus exporter pods and my nginx pod which makes the nginx pod not displayed here. I've tried adding a Git source as well as the same labels that are on the Pelorus exporter pods to my nginx pod, to no avail. The Git source is in my previous comment, and here are the labels that I've added to my nginx pod: link

What does Pelorus use/need to detect a pod if not labels?

from pelorus.

mateusoliveira43 avatar mateusoliveira43 commented on June 12, 2024

I would suggest using our demo as well https://github.com/dora-metrics/pelorus/tree/master/demo , instead of quickstart app, but I think it is a little broken

I will try to see later today if I can modify quickstart tutorial yaml so you can use it or provide you a simple app that you can use to test

About your question: its just the way Pelorus watches things in Openshift. The way Pelorus deploys its exporters (with DeployConfig) is one of the ways that Pelorus understands a deploy

from pelorus.

mateusoliveira43 avatar mateusoliveira43 commented on June 12, 2024

Hello @jkmattatall

So to answer your questions about Pelorus detecting Pods in OpenShift

for deploytime exporter, it looks all running pods (in the namespaces you specified) that are created by a ReplicaSet or ReplicationController. Code reference: https://github.com/dora-metrics/pelorus/blob/master/exporters/provider_common/openshift.py#L16

So, for pelorus to "see" a deployment, you would need a Deployment, for example.

If you want to test just deploytime exporter, I think this application is the simplest https://github.com/openshift/oadp-operator/blob/master/tests/e2e/sample-applications/nginx/nginx-deployment.yaml (just need to change app: for the APP_LABEL you are using).

For committime, it looks for Builds. Code reference: https://github.com/dora-metrics/pelorus/blob/master/exporters/committime/collector_base.py#L195-L201

I would suggest the Quick Start guide application for testing with committime. The 2 differences you would have is here https://github.com/konveyor/mig-demo-apps/blob/master/apps/todolist-mongo-go/mongo-persistent.yaml#L144 you would put the Gitea link for your fork (I do not know if you can directly fork from GitHub to Gitea, but if not, just copy the files) and you would not have the GitHub webhook, you would need to recreate the application for a new commit. This you can do? Or there limitation of your environment?

Please tell me if this helps you

from pelorus.

filiy avatar filiy commented on June 12, 2024

Hey @jkmattatall I'm thinking you can close this issue now? We figured out to get commit time metrics by using ImageStreams, Image Registry info, or webhooks.

from pelorus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.