Giter Club home page Giter Club logo

tekton-exporter's Introduction

Tekton Exporter

GitHub go.mod Go version (subdirectory of monorepo) GitHub

YouTube Channel Subscribers GitHub followers X (formerly Twitter) Follow

A Prometheus Exporter to collect and expose some useful fine-grained Tekton metrics that are not exposed natively

Motivation

In our platform team, we needed to build some useful dashboards to show our developers the status of the pipelines per project to make them compete for the first position on the reliability podium.

There are some metrics that are not exposed, which are necessary to achieve our goal, so we decided to create this small tool.

Flags

Every configuration parameter can be defined by flags that can be passed to the CLI. They are described in the following table:

Name Description Default Example
--log-level Define the verbosity of the logs info --log-level info
--disable-trace Disable traces from logs false --disable-trace true
--kubeconfig Path to kubeconfig - --kubeconfig="~/.kube/config"
--metrics-port Port where metrics web-server will run 2112 --metrics-port 9090
--metrics-host Host where metrics web-server will run 0.0.0.0 --metrics-host 10.10.10.1
--populated-labels (Repeatable or comma-separated list) Object labels populated on metrics - --populated-labels "apiVersion,pipelineName,projectName"

For Prometheus SDK, it is mandatory to register the metrics before using them. Due to this, if you use --populated-labels flag and the label is not present in some PipelineRun or TaskRun the label will be populated with # as value

Examples

Here you have a complete example to use this command.

Output is thrown always in JSON as it is more suitable for automations

tekton-exporter run \
    --log-level=info
    --kubeconfig="./path"

ATTENTION: If you detect some mistake on the examples, open an issue to fix it. This way we all will benefit

How to use

This project provides binary files and Docker images to make it easy to use wherever wanted

Binaries

Binary files for the most popular platforms will be added to the releases

Docker

Docker images can be found in GitHub's packages related to this repository

Do you need it in a different container registry? We think this is not needed, but if we're wrong, please, let's discuss it in the best place for that: an issue

Exposed metrics

This project is about exposing useful metrics related to the status of the Pipelines and Tasks, so, what about them?

Name Description Metric labels
tekton_exporter_pipelinerun_status Status of a PipelineRun name, namespace, status, reason
tekton_exporter_taskrun_status Status of a TaskRun name, namespace, status, reason
tekton_exporter_pipelinerun_duration_seconds Seconds lasted by a PipelineRun name, namespace, start_timestamp, completion_timestamp
tekton_exporter_taskrun_duration_seconds Seconds lasted by a TaskRun name, namespace, start_timestamp, completion_timestamp

How to contribute

We are open to external collaborations for this project: improvements, bugfixes, whatever.

For doing it, open an issue to discuss the need of the changes, then:

  • Fork the repository
  • Make your changes to the code
  • Open a PR and wait for review

The code will be reviewed and tested (always)

We are developers and hate bad code. For that reason we ask you the highest quality on each line of code to improve this project on each iteration.

License

Copyright 2022.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Special mention

This project was done using IDEs from JetBrains. They helped us to develop faster, so we recommend them a lot! ๐Ÿค“

JetBrains Logo (Main) logo.

tekton-exporter's People

Contributors

achetronic avatar

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.