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

WIP: feat(metrics): add actix-web metrics exporter #793

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
199 changes: 90 additions & 109 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ actix-cors = "0.6"
actix-http = "3"
actix-rt = "2"
actix-web = "4"
actix-web-prom = "0.6.0"
anyhow = "1.0"
async-trait = "0.1"
brotli = "3"
Expand Down
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,18 @@ Martin data is available via the HTTP `GET` endpoints:

## Documentation
See [Martin book](https://maplibre.org/martin/) for complete documentation.

## License

Licensed under either of

* Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or <http://www.apache.org/licenses/LICENSE-2.0>)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or <http://opensource.org/licenses/MIT>)
at your option.

### Contribution

Unless you explicitly state otherwise, any contribution intentionally
submitted for inclusion in the work by you, as defined in the
Apache-2.0 license, shall be dual licensed as above, without any
additional terms or conditions.
31 changes: 31 additions & 0 deletions debian/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Connection keep alive timeout [default: 75]
keep_alive: 75

# The socket address to bind [default: 0.0.0.0:3000]
listen_addresses: '0.0.0.0:3000'

# Number of web server workers
worker_processes: 8

# see https://maplibre.org/martin/config-file.html

# postgres:
# connection_string: 'postgresql://postgres@localhost:5432/db'
# default_srid: 4326
# pool_size: 20
# max_feature_count: 1000
# disable_bounds: false

# pmtiles:
# paths:
# - /dir-path
# - /path/to/pmtiles.pmtiles
# sources:
# pm-src1: /path/to/pmtiles1.pmtiles

# mbtiles:
# paths:
# - /dir-path
# - /path/to/mbtiles.mbtiles
# sources:
# mb-src1: /path/to/mbtiles1.mbtiles
8 changes: 8 additions & 0 deletions debian/martin.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[Unit]
Description = A blazing fast map tile server which can generate and serve vector tiles on the fly from large PostGIS databases, PMTile, and MBTile files

[Service]
ExecStart = /usr/bin/martin --config /usr/local/etc/martin/config.yaml

[Install]
WantedBy = multi-user.target
131 changes: 131 additions & 0 deletions demo/frontend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
### Node template
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
10 changes: 7 additions & 3 deletions demo/frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
FROM node:18-alpine as builder
FROM node:20-alpine as builder

WORKDIR /usr/src/app

COPY package.json .
COPY yarn.lock .
RUN yarn install

COPY . .
RUN npm i
RUN npm run build
CMD yarn run build
6 changes: 3 additions & 3 deletions demo/frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
Learn how to configure a non-root public URL by running `yarn run build`.
-->
<title>Martin — vector tiles server</title>
</head>
Expand All @@ -35,8 +35,8 @@
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.

To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
To begin the development, run `yarn start` or `yarn start`.
To create a production bundle, use `yarn run build` or `yarn build`.
-->
</body>
</html>
Loading