https://github.com/moesif/openresty-docker-demo
Lua Resty Moesif Example
https://github.com/moesif/openresty-docker-demo
Last synced: 3 months ago
JSON representation
Lua Resty Moesif Example
- Host: GitHub
- URL: https://github.com/moesif/openresty-docker-demo
- Owner: Moesif
- Created: 2019-05-10T23:11:29.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-12-27T19:57:55.000Z (10 months ago)
- Last Synced: 2025-03-26T00:23:09.709Z (7 months ago)
- Language: Lua
- Size: 23.4 KB
- Stars: 1
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## OpenResty with Moesif API Logging Example
Example Docker application using [Moesif OpenResty plugin](https://github.com/Moesif/lua-resty-moesif) to log API calls to [Moesif API analytics](https://www.moesif.com)
To learn more about configuration options, please refer to [Moesif OpenResty plugin](https://github.com/Moesif/lua-resty-moesif).
## How to run this example
1. Clone this repo and edit the `nginx.conf.d/main.conf` file to set your actual Moesif Application Id.Your Moesif Application Id can be found in the [_Moesif Portal_](https://www.moesif.com/).
After signing up for a Moesif account, your Moesif Application Id will be displayed during the onboarding steps.You can always find your Moesif Application Id at any time by logging
into the [_Moesif Portal_](https://www.moesif.com/), click on the top right menu,
and then clicking _API Keys_.2. Build the docker image
```bash
docker buildx build --platform linux/amd64 -t openresty-docker-demo ./
```3. Start the docker container:
```bash
docker-compose up -d
```By default, The container is listening on port 8000. You should now be able to make a request:
```bash
curl -X POST -H "Content-Type: application/json" -d '{"name":"moesif"}' "http://localhost:8000/api?x=2&y=4" -H 'User-Id:123' -H "Company-Id:567"
```4. The data should be captured in the corresponding Moesif account.
Congratulations! If everything was done correctly, Moesif should now be tracking all network requests that match the route you specified earlier. If you have any issues with set up, please reach out to support@moesif.com.