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

Add a config file example #163

Closed
robsonpeixoto opened this issue Feb 22, 2017 · 7 comments · Fixed by #260
Closed

Add a config file example #163

robsonpeixoto opened this issue Feb 22, 2017 · 7 comments · Fixed by #260

Comments

@robsonpeixoto
Copy link

The current document are missing a config file example. Please add one.

@boly38
Copy link

boly38 commented Aug 10, 2018

while waiting for doc (agree that is missing :) ),

I just add here one sample found from #217

Seems that listen hostname must match "-host" parameter
please note that I'm not toxiproxy contributor (only end-user)

cat config/proxies.json
[
  {
    "name": "id_dev_http",
    "listen": "0.0.0.0:26080",
    "upstream": "myproxyfiedService:8080"
  }
]

@alexgvo
Copy link

alexgvo commented Dec 13, 2018

Somebody know, can you add & assign toxics on proxies during startup of server? Using proxies.json?

@boly38
Copy link

boly38 commented Dec 13, 2018

(I've not done the test but ) @alexgvo did you try something similar to this sample (embedding toxics definiton) ?

{
    "tservice": {
        "name": "tservice",
        "listen": "[::]:9000",
        "upstream": "servicehost:8080",
        "enabled": true,
        "toxics": [
            {
                "attributes": {
                    "timeout": 0
                },
                "name": "serviceTimeout",
                "type": "timeout",
                "stream": "upstream",
                "toxicity": 1
            }
        ]
    },
    "tother": {
        "name": "tother",
        "listen": "[::]:9100",
        "upstream": "otherservice:8081",
        "enabled": true,
        "toxics": []
    }
}

@alexgvo
Copy link

alexgvo commented Dec 13, 2018

(I've not done the test but ) @alexgvo did you try something similar to this sample (embedding toxics definiton) ?

{
    "tservice": {
        "name": "tservice",
        "listen": "[::]:9000",
        "upstream": "servicehost:8080",
        "enabled": true,
        "toxics": [
            {
                "attributes": {
                    "timeout": 0
                },
                "name": "serviceTimeout",
                "type": "timeout",
                "stream": "upstream",
                "toxicity": 1
            }
        ]
    },
    "tother": {
        "name": "tother",
        "listen": "[::]:9100",
        "upstream": "otherservice:8081",
        "enabled": true,
        "toxics": []
    }
}

Yes, I have tried the same construction...didn't work for me.

{
		"name": "proxy1",
		"listen": "0.0.0.0:8474",
		"upstream": "127.0.0.1:8080",
        "enabled": true,
		"toxics": [{
			"name": "toxic1",
			"type": "latency",
			"stream": "downstream",
			"toxicity": 1,
			"attributes": {
				"latency": 20,
				"jitter": 5
			}

		}]
	}

@boly38
Copy link

boly38 commented Dec 13, 2018

ok sorry then :| - in addition, I made a mistake using {} instead of [].
NB/ 8474 is already toxiproxy default port (maybe you should avoid this port for your listen directive)

  • I've done test with /populate api, and toxics are not undertaken too.
  • I've done test with -config proxies.json that includes proxy+toxics, and proxy is well defined but with empty toxics (That confirm your test)

@jpittis
Copy link
Contributor

jpittis commented Dec 17, 2018

If you ping me on a PR to update the docs, it should be a quick turnaround to merge.

@KernelDeimos
Copy link

If anyone else finds this on Google like I did let me save you some time - adding toxics like this doesn't work right now.

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

Successfully merging a pull request may close this issue.

5 participants