Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sampling configuration neglected #2197

Open
rdepke opened this issue Apr 24, 2020 · 3 comments
Open

Sampling configuration neglected #2197

rdepke opened this issue Apr 24, 2020 · 3 comments

Comments

@rdepke
Copy link

rdepke commented Apr 24, 2020

Requirement - what kind of business use case are you trying to solve?

I want to configure sampling as described here https://www.jaegertracing.io/docs/1.17/sampling/

Problem - what in Jaeger blocks you from solving the requirement?

The configuration is neglected and I don't get any hints what I'm doing wrong.

Proposal - what do you suggest to solve the problem or improve the existing situation?

Jaeger should output currently used configuration on startup e.g.
Info: using sampling configuration /path/user/provided/file.json
Warn: sampling configuration /path/user/provided/file.json malformed

Something along those lines so I can see what's going on.

Any open questions to address

I use Jaeger in OpenShift to trace Java SpringBoot applications which is working great. I'll put our deployment config here so you can have a look if I do something obviously wrong.

---
parameters:
- description: The Jaeger image version to use
  displayName: Image version
  name: IMAGE_VERSION
  required: true
  value: "1.17.1"

kind: Template
apiVersion: v1
labels:
  app: jaeger
metadata:
  name: jaeger
  annotations:
    description: Jaeger Distributed Tracing Server
objects:
- kind: DeploymentConfig
  apiVersion: v1
  metadata:
    name: jaeger-collector
  spec:
    strategy:
      type: Rolling
    template:
      metadata:
        labels:
          name: jaeger-collector
      spec:
        containers:
        - name: jaeger-collector
          image: jaegertracing/jaeger-collector:${IMAGE_VERSION}
          args:
            - '--config-file=/conf/collector.yaml'
            - '--sampling.strategies-file=/sampling/sampling-strategies.json'
          ports:
          - containerPort: 14250
            protocol: TCP
          - containerPort: 14267
            protocol: TCP
          - containerPort: 14268
            protocol: TCP
          - containerPort: 14269
            protocol: TCP
          - containerPort: 9411
            protocol: TCP
          resources:
            requests:
              cpu: "100m"
              memory: "128M"
            limits:
              cpu: "1000m"
              memory: "2G"
          livenessProbe:
            tcpSocket:
              port: 14269
          readinessProbe:
            httpGet:
              path: "/"
              port: 14269
          volumeMounts:
          - name: jaeger-config-volume
            mountPath: /conf
          - name: jaeger-sampling-volume
            mountPath: /sampling
          env:
          - name: SPAN_STORAGE_TYPE
            value: elasticsearch
        volumes:
          - name: jaeger-config-volume
            secret:
              secretName: jaeger-secret
              items:
                - key: collector
                  path: collector.yaml
          - name: jaeger-sampling-volume
            configMap:
              name: jaeger-sampling-config
              items:
                - key: sampling-strategies.json
                  path: sampling-strategies.json
    replicas: 1
    triggers:
    - type: "ConfigChange"
- kind: DeploymentConfig
  apiVersion: v1
  metadata:
    name: jaeger-query
  spec:
    strategy:
      type: Rolling
    template:
      metadata:
        labels:
          name: jaeger-query
      spec:
        containers:
        - name: jaeger-query
          image: jaegertracing/jaeger-query:${IMAGE_VERSION}
          args: ["--config-file=/conf/query.yaml"]
          ports:
          - containerPort: 16686
            protocol: TCP
          - containerPort: 16687
            protocol: TCP
          resources:
            requests:
              cpu: "100m"
              memory: "128M"
            limits:
              cpu: "1000m"
              memory: "2G"
          readinessProbe:
            httpGet:
              path: "/"
              port: 16687
          volumeMounts:
          - name: jaeger-config-volume
            mountPath: /conf
          env:
          - name: SPAN_STORAGE_TYPE
            value: elasticsearch
        - name: jaeger-agent
          image: jaegertracing/jaeger-agent:${IMAGE_VERSION}
          args: ["--reporter.tchannel.host-port=jaeger-collector:14267"]
          ports:
          - containerPort: 6831
            protocol: UDP
          resources:
            requests:
              cpu: "100m"
              memory: "128M"
            limits:
              cpu: "1000m"
              memory: "2G"
        volumes:
          - name: jaeger-config-volume
            secret:
              secretName: jaeger-secret
              items:
                - key: query
                  path: query.yaml
    replicas: 1
    triggers:
    - type: "ConfigChange"

- kind: Service
  apiVersion: v1
  metadata:
    name: jaeger-collector
  spec:
    ports:
    - name: jaeger-collector-grpc
      port: 14250
      protocol: TCP
      targetPort: 14250
    - name: jaeger-collector-tchannel
      port: 14267
      protocol: TCP
      targetPort: 14267
    - name: jaeger-collector-http
      port: 14268
      protocol: TCP
      targetPort: 14268
    - name: jaeger-collector-metrics
      port: 14269
      protocol: TCP
      targetPort: 14269
    - name: jaeger-collector-zipkin
      port: 9411
      protocol: TCP
      targetPort: 9411
    selector:
      name: jaeger-collector

- apiVersion: v1
  kind: Service
  metadata:
    name: jaeger-query
  spec:
    ports:
    - name: jaeger-query-http
      port: 80
      protocol: TCP
      targetPort: 16686
    - name: jaeger-query-metrics
      port: 16687
      protocol: TCP
      targetPort: 16687
    selector:
      name: jaeger-query

- apiVersion: v1
  kind: Route
  metadata:
    name: jaeger-query
  spec:
    host: my-jaeger.host.org
    to:
      kind: Service
      name: jaeger-query
    port:
      targetPort: jaeger-query-http
    tls:
      insecureEdgeTerminationPolicy: Redirect
      termination: edge

- apiVersion: v1
  kind: Route
  metadata:
    name: jaeger-collector
  spec:
    to:
      kind: Service
      name: jaeger-collector
    port:
      targetPort: jaeger-collector-http
    tls:
      insecureEdgeTerminationPolicy: Redirect
      termination: edge

and this is the sampling configuration

{
    "service_strategies": [
    {
      "service": "testapp",
      "type": "probabilistic",
      "param": 0.0,
      "operation_strategies": [
        {
          "operation": "ok",
          "type": "probabilistic",
          "param": 0.0
        },
        {
          "operation": "query",
          "type": "probabilistic",
          "param": 0.0
        }
      ]
    }],
  "default_strategy": {
    "type": "ratelimiting",
    "param": 150,
    "operation_strategies": [
      {
        "operation": "/health",
        "type": "probabilistic",
        "param": 0.0
      },
      {
        "operation": "/metrics",
        "type": "probabilistic",
        "param": 0.0
      }
    ]
  }
}
@ghost ghost added the needs-triage label Apr 24, 2020
@pavolloffay
Copy link
Member

pavolloffay commented Apr 24, 2020

@rdepke could you please paste here the sampling configuration file?

if err := json.Unmarshal(bytes, &strategies); err != nil {
we could consider disabling unknown fields when unmarshalling.

@rdepke
Copy link
Author

rdepke commented Apr 24, 2020

Sure @pavolloffay
this is my sampling configuration which is very close to the config in the documentation example.

{
    "service_strategies": [
    {
      "service": "testapp",
      "type": "probabilistic",
      "param": 0.0,
      "operation_strategies": [
        {
          "operation": "ok",
          "type": "probabilistic",
          "param": 0.0
        },
        {
          "operation": "query",
          "type": "probabilistic",
          "param": 0.0
        }
      ]
    }],
  "default_strategy": {
    "type": "ratelimiting",
    "param": 150,
    "operation_strategies": [
      {
        "operation": "/health",
        "type": "probabilistic",
        "param": 0.0
      },
      {
        "operation": "/metrics",
        "type": "probabilistic",
        "param": 0.0
      }
    ]
  }
}

I add this to the original post as well.

@davidbartos
Copy link

davidbartos commented Jul 9, 2021

Hi Guys,

Is there any progress or solution related to this topic. I am experiencing the same issue as @rdepke, it looks like the strategies in the sampling config are not used.

Thanks

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

No branches or pull requests

3 participants