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

Support for inlined pipeline config for docker logger #1296

Closed
wapmorgan opened this issue Nov 20, 2019 · 23 comments · Fixed by #2076
Closed

Support for inlined pipeline config for docker logger #1296

wapmorgan opened this issue Nov 20, 2019 · 23 comments · Fixed by #2076
Assignees
Labels
keepalive An issue or PR that will be kept alive and never marked as stale.

Comments

@wapmorgan
Copy link
Contributor

Is your feature request related to a problem? Please describe.
When there's need to rebuild plugin or to copy file with pipeline to pluigin directory, it's big problem.

options:
    loki-url: ...
    loki-external-labels: container_name={{.Name}}
    loki-pipeline-stage-file: /ag/app.yaml

The problem is /ag/app.yaml is should be inside plugin container, not in root fs!

Describe the solution you'd like
Allow to inline pipeline stage config in config parameter. Like this:

options:
    loki-url: ...
    loki-external-labels: container_name={{.Name}}
    loki-pipeline-stages: 
      - json:
        // ...
      - output:
       // ..

Describe alternatives you've considered
Only injecting (copying) pipeline file to plugin directory.

@cyriltovena
Copy link
Contributor

Unfortunately docker options are only string value. But we are aware of the problem, on Linux it seems that you can have the file added to the plugin using a specific plugin path, there's some issues explaining this.

@wapmorgan
Copy link
Contributor Author

@cyriltovena yes, and now we using this case - copy file to plugin rootfs and then point it in configuration, but that seems very hard to maintain. Isn't there an ability to use specific path inside plugin that can be mounted when starting plugin?

@cyriltovena
Copy link
Contributor

see #1374 (comment)

@wapmorgan
Copy link
Contributor Author

see #1374 (comment)

I do exactly the same, but that looks weird. If that's all, thanks anyway

@cyriltovena
Copy link
Contributor

Would it be more helpful if the docker plugin forward log to a promtail container instance ? This way the you can easily configure promtail by mounting a host volume or a docker config ?

The downside is that you have to run a promtail container instance. This is something we've been thinking about.

@cyriltovena
Copy link
Contributor

So there’s a propagated mount config, I’ll try it.

@stale
Copy link

stale bot commented Jan 12, 2020

This issue has been automatically marked as stale because it has not had any activity in the past 30 days. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale A stale issue or PR that will automatically be closed. label Jan 12, 2020
@slim-bean slim-bean added the keepalive An issue or PR that will be kept alive and never marked as stale. label Jan 13, 2020
@stale stale bot removed the stale A stale issue or PR that will automatically be closed. label Jan 13, 2020
@slim-bean
Copy link
Collaborator

tagging this to keepalive as I still think there is a gap in configuring the pipeline for the docker logging driver.

@wapmorgan
Copy link
Contributor Author

So, is there any possibility for mounting config?

@cyriltovena
Copy link
Contributor

Yes we're explaining this here:

#1555

@slim-bean
Copy link
Collaborator

@cyriltovena can you test this with the Yaml multilline string marker:

options:
    loki-url: ...
    loki-external-labels: container_name={{.Name}}
    loki-pipeline-stages:  |
      - json:
        // ...
      - output:
       // ..

Don't know if that syntax is correct?

1 similar comment
@slim-bean
Copy link
Collaborator

@cyriltovena can you test this with the Yaml multilline string marker:

options:
    loki-url: ...
    loki-external-labels: container_name={{.Name}}
    loki-pipeline-stages:  |
      - json:
        // ...
      - output:
       // ..

Don't know if that syntax is correct?

@segler-alex
Copy link

segler-alex commented Apr 28, 2020

i would like this solution very much.

  • it is very easy to use
  • compiling it/rebuilding is not very user friendly, AND it is not documented anywhere but in github issues
  • mounting inside plugin did not work for me, AND is also not very easy to use
  • without pipelines it is not possible to add for example log level as a tag, and as far as I understand, this is best practice if you want to filter on it, because only tags are indexed and are fast to search for

@iabughosh
Copy link

Dears,
I tried the below command according to PR #1555:
docker plugin set loki mount.source={my-path}
But I've received this error :
Error response from daemon: setting "mount" not found in the plugin configuration

I am using the latest loki-docker-driver plugin and my docker version is 19.03.8 and my OS is MacOs.

Note : Also documentation doesn't contain any steps for what is being discussed here.

@wapmorgan
Copy link
Contributor Author

wapmorgan commented May 12, 2020

So, what about any updates?

@cyriltovena
Copy link
Contributor

cyriltovena commented May 14, 2020

  • without pipelines it is not possible to add for example log level as a tag, and as far as I understand, this is best practice if you want to filter on it, because only tags are indexed and are fast to search for

{app="foo"} |= "level=error" is also super fast. And not having the level label will make it so much easier to scale.

@wapmorgan
Copy link
Contributor Author

wapmorgan commented May 14, 2020

Ok, but I tried to make a graph for loki source in grafana. And without lables it's not possible to retrieve such data as level.
After all, labels are indexed, log messages are not. If I try to retrieve all error's for last hour, it will be really long action.

@cyriltovena
Copy link
Contributor

That's something we're solving very soon with logQL, actually before june ! I'll run a demo during the GrafanaCon Loki future talk.

@iabughosh
Copy link

Thanks for the update. Please inform us here if it is fixed. I really liked it!

@cyriltovena
Copy link
Contributor

cyriltovena commented May 14, 2020

LogQL will help you, but what we are talking here is allowing inline config for pipeline. I'm still working on that the config improvement even though LogQL will help.

@iabughosh
Copy link

I was able to filter with LogQl. But as @wapmorgan mentioned, we need pipelines for other purposes.

cyriltovena added a commit to cyriltovena/loki that referenced this issue May 14, 2020
Fixes grafana#1296

Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
@cyriltovena
Copy link
Contributor

Let me know what you think about the PR.

@iabughosh
Copy link

iabughosh commented May 14, 2020

Using in line stages is also awesome and works for me! But as I understood from the PR, you can't parse files unless it is inside the driver, You can't parse an external one, am I right?

slim-bean pushed a commit that referenced this issue May 14, 2020
* Allows to pass inlined pipeline stages to the docker driver.

Fixes #1296

Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>

* doc.

Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
cyriltovena added a commit to cyriltovena/loki that referenced this issue May 25, 2020
Fixes grafana#1296

Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
cyriltovena added a commit to cyriltovena/loki that referenced this issue May 25, 2020
Fixes grafana#1296

Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
owen-d pushed a commit that referenced this issue Jun 2, 2020
* Allows to pass inlined pipeline stages to the docker driver.

Fixes #1296

Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>

* Add validation before using storage config for the logcli.

Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
keepalive An issue or PR that will be kept alive and never marked as stale.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants