Skip to content
This repository has been archived by the owner on Oct 23, 2019. It is now read-only.

Allow configuring zipkin URL for zipkin-ui image #134

Closed
Rurouni opened this issue Feb 22, 2017 · 6 comments
Closed

Allow configuring zipkin URL for zipkin-ui image #134

Rurouni opened this issue Feb 22, 2017 · 6 comments

Comments

@Rurouni
Copy link

Rurouni commented Feb 22, 2017

At the moment in the zipkin-ui image nginx config has hardcoded http://zipkin:9411 https://github.com/openzipkin/docker-zipkin/blob/master/zipkin-ui/nginx.conf#L51
Works for compose but won't work with kubernetes pod for example (it needs to be localhost there)

It would be great if this docker image allowed configuring ZIPKIN_HTTP_ENDPOINT env var
Thank you

@codefromthecrypt
Copy link

I think this will be fixable in tandem with a change in zipkin-ui. We just need a quorum on how this will be sent to the javascript

openzipkin-attic/zipkin-ui#25

@charlescui
Copy link

@Rurouni @adriancole it's easy, just pass env at you compile zipkin-ui.

Find keyword baseUri in zipkin-ui, in the content you could write some code like:

@Injectable()
export class ZipkinService {
    traces: Trace[];
    baseUri: string;
    basePort: string;
    services: string[];

    constructor( @Inject(Http) private http: Http) {
        this.baseUri = process.env.ZIPKIN_HOST || 'localhost';
        this.basePort = process.env.ZIPKIN_PORT || '9411';
        this.traces = null;
    }

    getServices() {
        this
            .http
            .get(`http://${this.baseUri}:${this.basePort}/api/v1/services`, {})
            .subscribe(res => {
                this.services = <string[]>(res.json());
                this.services.push('[any]');
                this.services.sort();
            });
    }

just 2 files you should change:

➜  zipkin-ui git:(daily/1.2.0) ✗ ack baseUri
src/app/tracegraph/tracegraph.component.ts
12:    baseUri: string;
16:        this.baseUri = process.env.ZIPKIN_HOST || 'localhost';
24:            .get(`http://${this.baseUri}:${this.basePort}/api/v1/dependencies?endTs=1474206961061&lookback=86400000`, {})

src/app/zipkin/zipkin.ts
157:    baseUri: string;
162:        this.baseUri = process.env.ZIPKIN_HOST || 'localhost';
170:            .get(`http://${this.baseUri}:${this.basePort}/api/v1/services`, {})
184:        var uri = `http://${this.baseUri}:${this.basePort}/api/v1/traces?endTs=${endTs}&lookback=${lookback}&annotationQuery=&limit=${limit}&minDuration=${minDuration}&spanName=all`;

I will make a docker image for run in k8s.

@codefromthecrypt
Copy link

codefromthecrypt commented Mar 22, 2017 via email

@codefromthecrypt
Copy link

openzipkin-attic/zipkin-ui#34 suggests separate env variables to assign this.. like export ZIPKIN_HOST=172.16.10.56 ZIPKIN_PORT=32008 please give feedback if this works for you or not.

Personally, I like ZIPKIN_HTTP_ENDPOINT or similar better as this is less sensitive to people who might have an SSL endpoint or have mounted the zipkin api under /zipkin.

@charlescui
Copy link

@adriancole mount a url path is a good idear.I have mount ui at /zipkin with expressjs server and httpProxy serve it.

codefromthecrypt pushed a commit that referenced this issue Apr 14, 2017
This changes the zipkin-ui image to rewrite nginx configuration on start
based on the `ZIPKIN_BASE_URL` variable, which defaults to
'http://zipkin:9411'. Users can change this variable to point at a
different zipkin host such as a kubernetes pod.

See openzipkin-attic/zipkin-ui#38
Fixes #134
codefromthecrypt pushed a commit that referenced this issue Apr 14, 2017
This changes the zipkin-ui image to rewrite nginx configuration on start
based on the `ZIPKIN_BASE_URL` variable, which defaults to
'http://zipkin:9411'. Users can change this variable to point at a
different zipkin host such as a kubernetes pod.

See openzipkin-attic/zipkin-ui#38
Fixes #134
@codefromthecrypt
Copy link

Thanks for all the patience and the help

I re-pushed docker images for 1.22.1 including a now working zipkin-ui image!

screen shot 2017-04-14 at 5 52 17 pm

cc @llinder @rogeralsing

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

No branches or pull requests

3 participants