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

Update loki push path #1049

Merged
merged 13 commits into from
Sep 25, 2019
Prev Previous commit
Next Next commit
Updated docs and examples
Signed-off-by: Joe Elliott <number101010@gmail.com>
  • Loading branch information
joe-elliott committed Sep 24, 2019
commit 64971f34d7832ea4c61ea679dea17ff3e423dcd6
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ data:
local timestamp=$(date -Iseconds -u | sed 's/UTC/.000000000+00:00/')
local data=$(jq -n --arg timestamp "${timestamp}" '{"streams": [{"labels": "{app=\"loki-test\"}", "entries": [{"ts": $timestamp, "line": "foobar"}]}]}')

curl -s -X POST -H "Content-Type: application/json" ${LOKI_URI}/api/prom/push -d "${data}"
curl -s -X POST -H "Content-Type: application/json" ${LOKI_URI}/loki/api/v1/push -d "${data}"

curl -sG ${LOKI_URI}/api/prom/query?limit=1 --data-urlencode 'query={app="loki-test"}' | \
jq -e '.streams[].entries[].line == "foobar"'
Expand Down
4 changes: 2 additions & 2 deletions production/helm/promtail/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ spec:
args:
- "-config.file=/etc/promtail/promtail.yaml"
{{- if and .Values.loki.user .Values.loki.password }}
- "-client.url={{ .Values.loki.serviceScheme }}://{{ .Values.loki.user }}:{{ .Values.loki.password }}@{{ include "loki.serviceName" . }}:{{ .Values.loki.servicePort }}/api/prom/push"
- "-client.url={{ .Values.loki.serviceScheme }}://{{ .Values.loki.user }}:{{ .Values.loki.password }}@{{ include "loki.serviceName" . }}:{{ .Values.loki.servicePort }}/loki/api/v1/push"
{{- else }}
- "-client.url={{ .Values.loki.serviceScheme }}://{{ include "loki.serviceName" . }}:{{ .Values.loki.servicePort }}/api/prom/push"
- "-client.url={{ .Values.loki.serviceScheme }}://{{ include "loki.serviceName" . }}:{{ .Values.loki.servicePort }}/loki/api/v1/push"
{{- end }}
volumeMounts:
- name: config
Expand Down
2 changes: 1 addition & 1 deletion tools/promtail.sh
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ spec:
spec:
containers:
- args:
- -client.url=https://<instanceId>:<apiKey>@<instanceUrl>/api/prom/push
- -client.url=https://<instanceId>:<apiKey>@<instanceUrl>/loki/api/v1/push
- -config.file=/etc/promtail/promtail.yml
env:
- name: HOSTNAME
Expand Down