Skip to content

Can't expose port for git-sync metrics #62592

Description

@jeff-cook

Official Helm Chart version

1.19.0 (latest released)

Apache Airflow version

1.3.7

Kubernetes Version

v1.33.7-eks-ac2d5a0

Helm Chart configuration

I have enabled metrics on the git-sync containers. However there is no option to expose the port to collect the metrics.

dags:
  gitSync:
      env:
        - name: GITSYNC_HTTP_BIND
          value: ":1234"
        - name: GITSYNC_HTTP_METRICS
          value: "true"

Docker Image customizations

None

What happened

I have enabled metrics on the git-sync containers. However there is no option to expose the port to collect the metrics.

What you think should happen instead

Can we add ports section to the gitSync config?

dags:
  gitSync: 
    ports: []

How to reproduce

Enable gitSync and add the following.

dags:
  gitSync:
      env:
        - name: GITSYNC_HTTP_BIND
          value: ":1234"
        - name: GITSYNC_HTTP_METRICS
          value: "true"

Anything else

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

  1. aviralgarg05 commented on Mar 1, 2026

    @aviralgarg05
    Contributor

    I would like to solve this issue please assign me

  2. Miretpl commented on Mar 2, 2026

    @Miretpl
    Contributor

    Hi @jeff-cook, part of it will be resolved with #62334, as I need a liveness metric server to run probes. After this one, the only additions of GITSYNC_HTTP_METRICS and GIT_SYNC_HTTP_METRICS would be required.

    Hi @aviralgarg05, there was new assignment policy introduced within Airflow project - https://github.com/apache/airflow/blob/main/contributing-docs/04_how_to_contribute.rst#contribute-code-changes. Please take a look at it

  3. jeff-cook commented on Mar 2, 2026

    @jeff-cook
    Author

    Hi @jeff-cook, part of it will be resolved with #62334, as I need a liveness metric server to run probes. After this one, the only additions of GITSYNC_HTTP_METRICS and GIT_SYNC_HTTP_METRICS would be required.

    Thanks I do look forward to that!

    I tool a quick look at the PR and didn't see ports in the container spec yet.
    https://kubernetes.io/docs/tutorials/services/connect-applications-service/#exposing-pods-to-the-cluster

  4. Miretpl commented on Mar 8, 2026

    @Miretpl
    Contributor

    I tool a quick look at the PR and didn't see ports in the container spec yet.

    It will not have one, as it is not required for probes to work, but the logic with HTTP_BIND, together with tests, will be there. The current content of the PR is the final one. Feel free to take a look at the HTTP_BIND-related part

  5. jeff-cook commented on Mar 9, 2026

    @jeff-cook
    Author

    I tool a quick look at the PR and didn't see ports in the container spec yet.

    It will not have one, as it is not required for probes to work, but the logic with HTTP_BIND, together with tests, will be there. The current content of the PR is the final one. Feel free to take a look at the HTTP_BIND-related part

    Ok, thanks. I can configure the bind and metrics via environment variables with the helm chart.

    dags:
      gitSync:
          env:
            - name: GITSYNC_HTTP_BIND
              value: ":1234"
            - name: GITSYNC_HTTP_METRICS
              value: "true"
    

    But what I can't do is expose the port so prometheus can scape the metrics.

  6. Miretpl commented on Mar 11, 2026

    @Miretpl
    Contributor

    Exposing the metrics and port itself by dedicated service will have to be done in a different PR than mine above, as it was not in the scope of #62334.

  7. PreethamSanji commented on Jul 10, 2026

    @PreethamSanji
    Contributor

    Working on this. Plan: add containerPort for the git-sync HTTP bind port plus a dags.gitSync.metrics enable flag; open question whether a Service is wanted or whether pod-level exposure is enough for scraping, opinions?

  8. removed
    kind:bugThis is a clearly a bug
    needs-triagelabel for new issues that we didn't triage yet
    on Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions