Skip to content

Scrape Application Metrics #8047

Closed
Closed

Description

@nmnellis

/area monitoring

What version of Knative?

0.14.x

Expected Behavior

we would like to scrape the application pod for its http prometheus metrics (on separate port because we use grpc) but if we add the extra port we get the error More than one container port is set: spec.template.spec.containers[0].ports Only a single port is allowed

Is there a way to expose application custom prometheus metrics?

Actual Behavior

Error when adding prometheus port More than one container port is set: spec.template.spec.containers[0].ports Only a single port is allowed

Steps to Reproduce the Problem

List 2 ports

          - name: h2c
            containerPort: 8080
          - name: http-prom
            containerPort: 9092

Related

#7140

Activity

  1. added
    kind/bug
    on May 23, 2020
  2. vagababov commented on May 23, 2020

    @vagababov
    Contributor

    If you need something to work, then you can just expose (as in serve metrics on it) your second port and then add a manual k8s service with the same selector but looking at the 9092 port.

  3. nmnellis commented on May 23, 2020

    @nmnellis
    Author

    I want to scrape each pod individually but thanks for the workaround

  4. jeffgriffith commented on Jun 22, 2020

    @jeffgriffith

    I can't quite tell - is issue 1411 meant to solve this problem? In my case, i'm not using kn monitoring, I simply want to grab the Prometheus metrics myself via our own components (ServiceMonitor) on its port (:8002/metrics).

  5. mattmoor commented on Aug 17, 2020

    @mattmoor
    Contributor

    @evankanderson What is our forward-looking guidance here?

  6. mattmoor commented on Aug 17, 2020

    @mattmoor
    Contributor

    Consolidating these under: #8471

  7. evankanderson commented on Aug 18, 2020

    @evankanderson
    Member

    I think our forward-looking guidance is that Knative isn't particularly doing anything "special" Kubernetes-wise, and metrics observation should be cluster-wide infrastructure (except that inbound scraping via Prometheus is a bit tricky, and users probably want to use the Prometheus push gateway or the OpenCensus Collector for application metrics).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/monitoringkind/bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions