Skip to content
This repository has been archived by the owner on Nov 20, 2023. It is now read-only.

How can I inject dapr.io/config: "tracing" using tye? #296

Closed
thangchung opened this issue Apr 3, 2020 · 5 comments · Fixed by #376
Closed

How can I inject dapr.io/config: "tracing" using tye? #296

thangchung opened this issue Apr 3, 2020 · 5 comments · Fixed by #376
Labels
enhancement New feature or request
Milestone

Comments

@thangchung
Copy link
Contributor

thangchung commented Apr 3, 2020

Currently, I use tye to deploy my application to AKS. Everything is fine now. But with Dapr in-place we can do the tracing out of the box. See at https://github.com/dapr/docs

So I have a quick question that how can we inject dapr.io/config: "tracing" into the deployment to enable the tracing with Open Telemetry using tye?

@davidfowl
Copy link
Member

Are you talking about adding annotations for deployment using tye?

@thangchung
Copy link
Contributor Author

Yes, it is. Just adding more like below

annotations:
	...
    dapr.io/config: "tracing"
    dapr.io/log-level: "debug"

@davidfowl
Copy link
Member

cc @rynowak

@rynowak rynowak added the enhancement New feature or request label Apr 3, 2020
@rynowak
Copy link
Member

rynowak commented Apr 3, 2020

@thangchung - thanks for blogging us, I enjoyed the read, and I'm glad you find our project interesting.


We haven't done anything to enable this yet.

Some ideas:

  • We will eventually add some features to customize the k8s manifests annotations and labels, but this doesn't seem like a great case for that because....
  • We can add per-extension settings that don't necessary map 1:1 to k8s, or have a different meaning in local development

Example:

extensions:
- name: dapr
  config: myconfig
  log-level: debug

This would map to the annotations you defined above when deployed, and could map to config myconfig -log-level=debug when running locally.

This seems like it should just work would all you to have access to all of dapr's config settings in local dev.

If you're interested in sending a PR - all the changes would go into DaprExtension. Otherwise, I can add this sometime in the next few days.

@rynowak rynowak added this to the 0.1 milestone Apr 3, 2020
@rynowak
Copy link
Member

rynowak commented Apr 17, 2020

Keeping open because I need to fix something with the local dev part of this. Deployment support is merged. Thanks @thangchung 👍

rynowak added a commit that referenced this issue Apr 17, 2020
Fixes #296

Adds conditional logic for passing these properties to `daprd`.

Corrects logic for dealing with config. Dapr's config annotation in k8s
refers to kubernetes resource by name, but that's not possible with
local run. In local run `dapr` will expect the `-config` parameter to be
a file on disk. So, this change adds logic to look for a file by naming
convention and pass that locally instead.

Additionally added the ability for an extension to output to the console
- this is needed because we want to tell the user if their config file
can't be found, and specifically where we looked. I made the decision to
log a message and skip if the config file isn't present, because we
don't have a way to make settings conditional based on environment yet -
it makes sense that someone might need to have a config in production
but not in local dev.
rynowak added a commit that referenced this issue Apr 17, 2020
Fixes #296

Adds conditional logic for passing these properties to `daprd`.

Corrects logic for dealing with config. Dapr's config annotation in k8s
refers to kubernetes resource by name, but that's not possible with
local run. In local run `dapr` will expect the `-config` parameter to be
a file on disk. So, this change adds logic to look for a file by naming
convention and pass that locally instead.

Additionally added the ability for an extension to output to the console
- this is needed because we want to tell the user if their config file
can't be found, and specifically where we looked. I made the decision to
log a message and skip if the config file isn't present, because we
don't have a way to make settings conditional based on environment yet -
it makes sense that someone might need to have a config in production
but not in local dev.
kishanAnem pushed a commit to kishanAnem/tye that referenced this issue Apr 19, 2020
Fixes dotnet#296

Adds conditional logic for passing these properties to `daprd`.

Corrects logic for dealing with config. Dapr's config annotation in k8s
refers to kubernetes resource by name, but that's not possible with
local run. In local run `dapr` will expect the `-config` parameter to be
a file on disk. So, this change adds logic to look for a file by naming
convention and pass that locally instead.

Additionally added the ability for an extension to output to the console
- this is needed because we want to tell the user if their config file
can't be found, and specifically where we looked. I made the decision to
log a message and skip if the config file isn't present, because we
don't have a way to make settings conditional based on environment yet -
it makes sense that someone might need to have a config in production
but not in local dev.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants