Commit graph

44 commits

Author SHA1 Message Date
Fish-pro
039a4d87e2
Use http constants instead of string (#5908)
Signed-off-by: Fish-pro <zechun.chen@daocloud.io>
2023-02-09 12:29:49 +01:00
Ondřej Benkovský
abc5ac8017
plugin/trace : make zipkin HTTP reporter more configurable using Corefile (#5460)
* plugin/trace : make zipkin HTTP reporter more configurable using Corefile

Signed-off-by: Ondřej Benkovský <ondrej.benkovsky@jamf.com>
2022-07-08 07:20:19 -04:00
Ondřej Benkovský
501e50312e
plugin/trace: make zipkin and datadog reporters log errors using CoreDNS logger (#5452) 2022-06-23 03:40:13 -07:00
Ondřej Benkovský
af4d84d915
plugin/trace: read trace context info from headers for DOH (#5439)
Signed-off-by: Ondřej Benkovský <ondrej.benkovsky@jamf.com>
2022-06-20 07:08:53 -07:00
coredns[bot]
3f881c7202 auto remove trailing whitespaces
Signed-off-by: coredns[bot] <bot@bot.coredns.io>
2021-07-20 10:28:21 +00:00
coredns[bot]
fcc52d8038 auto go fmt
Signed-off-by: coredns[bot] <bot@bot.coredns.io>
2021-07-19 10:28:07 +00:00
Ondřej Benkovský
936b483a3a
publish trace id as metadata from trace plugin (#4749)
Signed-off-by: Ondrej Benkovsky <ondrej.benkovsky@wandera.com>
2021-07-14 09:21:41 +02:00
Ondřej Benkovský
d17e50afc7
plugin/trace: fix rcode tag in case of no response (#4742)
Signed-off-by: Ondrej Benkovsky <ondrej.benkovsky@wandera.com>
2021-07-10 07:34:53 +02:00
coredns[bot]
c610bfd87f auto go fmt
Signed-off-by: coredns[bot] <bot@bot.coredns.io>
2021-07-05 10:34:54 +00:00
Ondřej Benkovský
9e90d6231e
trace plugin can mark traces with error tag (#4720)
Signed-off-by: Ondrej Benkovsky <ondrej.benkovsky@wandera.com>
2021-06-29 09:10:22 +02:00
Bob
d8d2c16905
plugin/trace - Use compatible tag name for datadog (#4408)
Traces are currently working properly with datadog with the exception of having the ability to facet the tags

![image](https://user-images.githubusercontent.com/5513509/105051238-dddbbd00-5a6e-11eb-8fb2-071b3b1fa8cc.png)

In order to get valuable graph in dashboard the tag on the metrics need to be faceted by datadog.
This PR update the tags with facetable path.
While keeping backward compatibility with existing path for zipkin.

Graph like:
![image](https://user-images.githubusercontent.com/5513509/93375960-339e1f80-f859-11ea-81f0-a1074c375630.png)
![image](https://user-images.githubusercontent.com/5513509/93375997-4153a500-f859-11ea-9f8d-63d45217c681.png)
![image](https://user-images.githubusercontent.com/5513509/93376064-5597a200-f859-11ea-823a-6768f59e3497.png)
![image](https://user-images.githubusercontent.com/5513509/93376405-d6ef3480-f859-11ea-8d6f-58dda247cc86.png)
![image](https://user-images.githubusercontent.com/5513509/93376518-069e3c80-f85a-11ea-9a7e-0426a3817439.png)

Signed-off-by: bob <bob.bouteillier@datadoghq.com>
2021-01-28 16:38:24 +01:00
Chotiwat Chawannakul
aac422ff0f
Update README.md (#4331)
Automatically submitted.
2020-12-11 21:07:25 +00:00
Miek Gieben
99f79817ac
plugin/trace: cleanup README.md (#4280)
Various improvements to the documentation. Started because `⚠️`
isn't a markdown feature (replace with Note:).

Signed-off-by: Miek Gieben <miek@miek.nl>
2020-11-19 12:19:50 +01:00
coredns-auto-go-fmt[bot]
4b87be2a0e auto go fmt 2020-11-11 12:30:39 +00:00
Bob
b7814204a4
plugin/trace: Fix zipkin json_v2 (#4180)
Automatically submitted.
2020-11-10 19:03:14 +00:00
Miek Gieben
c2e4f2f1ab
docs: move Also See to See Also (#4245)
sed -i 's/Also See/See Also/' plugin/**/README.md

Some plugins did already use 'See Also', so it's all consistent now.

Fixes: #4196

Signed-off-by: Miek Gieben <miek@miek.nl>
2020-10-28 10:56:35 -07:00
Bob
0835f5bb5f
[plugin][trace] - Have a consistent spanName (#4171)
Automatically submitted.
2020-10-12 19:30:55 +00:00
Miek Gieben
0cb0136570
Add proto and remote tags to trace plugin (#4159)
* Add proto and client-ip trace tags

Signed-off-by: Adam Malcontenti-Wilson <amalcontenti-wilson@zendesk.com>

* Commit my own suggestion

Signed-off-by: Miek Gieben <miek@miek.nl>

Co-authored-by: Adam Malcontenti-Wilson <amalcontenti-wilson@zendesk.com>
2020-09-29 10:43:58 +02:00
Miek Gieben
b003d06003
For caddy v1 in our org (#4018)
* For caddy v1 in our org

This RP changes all imports for caddyserver/caddy to coredns/caddy. This
is the v1 code of caddy.

For the coredns/caddy repo the following changes have been made:

* anything not needed by us is deleted
* all `telemetry` stuff is deleted
* all its import paths are also changed to point to coredns/caddy
* the v1 branch has been moved to the master branch
* a v1.1.0 tag has been added to signal the latest release

Signed-off-by: Miek Gieben <miek@miek.nl>

* Fix imports

Signed-off-by: Miek Gieben <miek@miek.nl>

* Group coredns/caddy with out plugins

Signed-off-by: Miek Gieben <miek@miek.nl>

* remove this file

Signed-off-by: Miek Gieben <miek@miek.nl>

* Relax import ordering

github.com/coredns is now also a coredns dep, this makes
github.com/coredns/caddy fit more natural in the list.

Signed-off-by: Miek Gieben <miek@miek.nl>

* Fix final import

Signed-off-by: Miek Gieben <miek@miek.nl>
2020-09-24 18:14:41 +02:00
Zou Nengren
8e1ab71720
bump prometheus with zipkin (#4109)
Signed-off-by: zounengren <zounengren@cmss.chinamobile.com>
2020-09-16 11:33:08 -07:00
Miek Gieben
e082bb5a61
plugin/trace: fix struct allignment (#4112)
* plugin/trace: fix struct allignment

A 64 bit entity needs to be the first in a struct to make it work on 32
bit systems.

Fixes: #4111

Signed-off-by: Miek Gieben <miek@miek.nl>

* plugin/erratic does makes the same mistake

Signed-off-by: Miek Gieben <miek@miek.nl>
2020-09-09 10:45:14 +02:00
Oleg Atamanenko
c86be3428a
Disable debug mode for tracing - removes extra logging (#4016)
Signed-off-by: Oleg Atamanenko <oleg.atamanenko@gmail.com>
2020-07-23 09:40:17 +02:00
Miek Gieben
995179a6c6
presubmit: check import path ordering (#3636)
Add a test for this as well as it's annoying to point out in every code
review.
Fix all the import paths that are flagged by this new test.

Fixes: #3634

Signed-off-by: Miek Gieben <miek@miek.nl>
2020-01-30 09:19:26 +00:00
Miek Gieben
24176a97e6
Move to CODEOWNERS (#3489)
* Move to CODEOWNERS

No change in who own what; just a move to CODEOWNERS. This allows
dreck cleanups.

Added .dreck.yaml for alias and exec.

Fixes: #3486

Signed-off-by: Miek Gieben <miek@miek.nl>

* stickler bot

Signed-off-by: Miek Gieben <miek@miek.nl>

* sort the file

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-11-29 13:17:05 +00:00
Miek Gieben
dbd1c047cb
Run gostaticheck (#3325)
* Run gostaticheck

Run gostaticcheck on the codebase and fix almost all flagged items.

Only keep

* coremain/run.go:192:2: var appVersion is unused (U1000)
* plugin/chaos/setup.go:54:3: the surrounding loop is unconditionally terminated (SA4004)
* plugin/etcd/setup.go:103:3: the surrounding loop is unconditionally terminated (SA4004)
* plugin/pkg/replacer/replacer.go:274:13: argument should be pointer-like to avoid allocations (SA6002)
* plugin/route53/setup.go:124:28: session.New is deprecated: Use NewSession functions to create sessions instead. NewSession has the same functionality as New except an error can be returned when the func is called instead of waiting to receive an error until a request is made.  (SA1019)
* test/grpc_test.go:25:69: grpc.WithTimeout is deprecated: use DialContext and context.WithTimeout instead.  Will be supported throughout 1.x.  (SA1019)

The first one isn't true, as this is set via ldflags. The rest is
minor. The deprecation should be fixed at some point; I'll file some
issues.

Signed-off-by: Miek Gieben <miek@miek.nl>

* Make sure to plug in the plugins

import the plugins, that file that did this was removed, put it in the
reload test as this requires an almost complete coredns server.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-10-01 07:41:29 +01:00
Miek Gieben
004c5fca9d
all: simply registering plugins (#3287)
Abstract the caddy call and make it simpler.

See #3261 for some part of the discussion.

Go from:

~~~ go
func init() {
       caddy.RegisterPlugin("any", caddy.Plugin{
               ServerType: "dns",
               Action:     setup,
       })
}
~~~

To:

~~~ go
func init() { plugin.Register("any", setup) }
~~~

This requires some external documents in coredns.io to be updated as
well; the old way still works, so it's backwards compatible.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-09-20 08:02:30 +01:00
Yong Tang
b8f40a8150 Move github.com/openzipkin/zipkin-go-opentracing => github.com/openzipkin-contrib/zipkin-go-opentracing (#3070)
Move github.com/openzipkin/zipkin-go-opentracing => github.com/openzipkin-contrib/zipkin-go-opentracing
and run `go mod tidy`

Fixes 3069

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2019-07-31 06:44:56 +00:00
Yong Tang
f8bba51f84
Update Caddy to 1.0.1, and update import path (#2961)
* Update Caddy to 1.0.1, and update import path

This fix updates caddy to 1.0.1 and also
updates the import path to github.com/caddyserver/caddy

This fix fixes 2959

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

* Also update plugin.cfg

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

* Update and bump zplugin.go

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2019-07-03 09:04:47 +08:00
Yong Tang
f13482f4d1 Follow up on PR 2868 (#2877)
This fix is a follow up on comment https://github.com/coredns/coredns/pull/2868#discussion_r291609761

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2019-06-10 10:02:02 +01:00
Anshul Sharma
74303a985c Fix Datadog tracer (#2868)
- Fixes #2862
2019-06-09 13:44:19 -07:00
Miek Gieben
9a8c301a42 Remove server addr from the context (#2722)
* more

Signed-off-by: Miek Gieben <miek@miek.nl>

* Remove server addr from the context

This was added twice, just leave the server which also holds the
address.

Conflicts with #2719 but should be easy to fix.

Signed-off-by: Miek Gieben <miek@miek.nl>

* doesn't need server context

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-03-25 10:46:44 -07:00
Miek Gieben
91d6451684
plugin/trace: update datadog import (#2676)
Use gopkg.in/DataDog/dd-trace-go.v0 as this is the new home for it

Fixes: #2282

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-03-12 11:01:47 +00:00
Nic Cope
8a9c6174fc Add request and response context to traces (#2162)
Automatically submitted.
2018-10-05 20:13:16 +00:00
Miek Gieben
f3134da45e
Clean up tests logging (#1979)
* Clean up tests logging

This cleans up the travis logs so you can see the failures better.

Older tests in tests/ would call log.SetOutput(ioutil.Discard) in
a haphazard way. This add log.Discard and put an `init` function in each
package's dir (no way to do this globally). The cleanup in tests/ is
clear.

All plugins also got this init function to have some uniformity and kill
any (future) logging there in the tests as well.

There is a one-off in pkg/healthcheck because that does log.

Signed-off-by: Miek Gieben <miek@miek.nl>

* bring back original log_test.go

Signed-off-by: Miek Gieben <miek@miek.nl>

* suppress logging here as well

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-07-19 16:23:06 +01:00
Miek Gieben
d3f2d4a291
core: remove HostAddresses() (#1728)
* core: remove HostAddresses()

config.HostAddresses() is a weird function that gathers
some data from the server and returns a string.

It is *only* used the trace plugin, to figure out what
server starts the trace.

Looks to be better to fit in the with metrics.WithServer label
on the trace itself to show which server handled the trace.

Remove HostAddresses() and cleanup trace a small bit.:w

* lint
2018-04-25 15:27:25 +01:00
Miek Gieben
0930eb8beb
all: fix plugin import ordering (#1717)
Got a bit messed up with stb lib "context" usage.
2018-04-22 08:34:35 +01:00
Miek Gieben
8722336fff
global: move to context (#1699)
* global: move to context

Move from golang.org/x/net/context to std lib's context.

Change done with:

for i in $(grep -l '/context' **/*.go); do sed -e 's|golang.org/x/net/context|context|' -i $i; echo $i; done
for i in **/*.go; do goimports -w $i; done

* drop from dns.pb.go as well
2018-04-20 11:01:06 +01:00
Yamil Asusta
87790dd47c Add DD support (#1596) 2018-03-09 15:08:57 -05:00
Francois Tur
76455c6a0d Plugin/BIND - extend the syntax to allow multiple addresses (#1512)
* Extend bind to allow multiple addresses. UTs added. Changes the log for server starting, adding address when available

* update readme for bind

* fixes after review

* minor fix on readme

* accept multiple BIND directives in blocserver, consolidate the addresses

* fixes after review - format logging server address, variable names
2018-02-14 20:19:32 +01:00
Miek Gieben
fd7abd9849
Add OWNERS file (#1486)
This should have everyone, but the process was quite manual. The rename
from middleware -> plugin also meant I had to do some extra digging on
who actually submitted the PR. I also double checked the current list of
people with commit access.

Every plugin now has an OWNERS, except *reverse*. I'll file a bug for
that.
2018-02-08 10:55:51 +00:00
Miek Gieben
58221f55db
Manual pages (#1346)
* Add manual pages

Generate manual pages from the README and extend README with Name and
Description sections.

The generation requires 'ronn' which may not be available. Just check in
all generated manual pages.
2018-01-04 12:53:07 +00:00
Miek Gieben
2388e36c2c plugin: README.md updates (#1084)
updates so the look better on coredns.io
2017-09-15 22:27:55 +01:00
Miek Gieben
ae9cae67e3 plugins: expand examples (#1077)
* plugins: expand examples

Expand some examples and test them by annotating it with `corefile`

* Can't start kubernetes

* Can test pprof :(
2017-09-15 09:56:05 +01:00
Miek Gieben
d8714e64e4 Remove the word middleware (#1067)
* Rename middleware to plugin

first pass; mostly used 'sed', few spots where I manually changed
text.

This still builds a coredns binary.

* fmt error

* Rename AddMiddleware to AddPlugin

* Readd AddMiddleware to remain backwards compat
2017-09-14 09:36:06 +01:00