Skip to content

Commit

Permalink
[metrics] Add OpenAI metrics about chat completions and text completi…
Browse files Browse the repository at this point in the history
…ons (#684)
  • Loading branch information
eolivelli authored Nov 3, 2023
1 parent 8cec56b commit 4171599
Show file tree
Hide file tree
Showing 11 changed files with 2,317 additions and 27 deletions.
File renamed without changes.
2,037 changes: 2,037 additions & 0 deletions docker/metrics/dashboards/apps.json

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions docker/metrics/prometheus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#
# Copyright DataStax, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

global:
scrape_interval: 15s

scrape_configs:
- job_name: 'langstream'
static_configs:
- targets: ['host.docker.internal:8790']
labels:
namespace: 'ls-docker'
pod: 'app-docker-local'
langstream_application: 'app'
langstream_agent: 'docker'
30 changes: 30 additions & 0 deletions docker/metrics/provisioning/dashboards/dashboards.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#
# Copyright DataStax, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

apiVersion: 1

providers:
- name: 'langstream'
orgId: 1
folder: ''
folderUid: '123123'
type: file
disableDeletion: false
updateIntervalSeconds: 10
allowUiUpdates: true
options:
path: /var/lib/grafana/dashboards
foldersFromFilesStructure: true
23 changes: 23 additions & 0 deletions docker/metrics/provisioning/datasources/prometheus-datasources.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#
# Copyright DataStax, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

apiVersion: 1
datasources:
- name: prometheus
type: prometheus
access: proxy
url: http://host.docker.internal:9090
isDefault: true
34 changes: 34 additions & 0 deletions docker/metrics/run-local-grafana.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#
# Copyright DataStax, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

#/bin/bash

HERE=$(dirname $0)
docker rm -f prometheus
docker run -d -p 9090:9090 --name prometheus -v $HERE/prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus
docker rm -f grafana

docker run -d -p 3000:3000 --name=grafana \
-e "GF_SECURITY_ADMIN_USER=admin" \
-e "GF_SECURITY_ADMIN_PASSWORD=admin" \
-v $HERE/provisioning:/etc/grafana/provisioning \
-v $HERE/dashboards:/var/lib/grafana/dashboards \
grafana/grafana


echo "Open Grafana at http://localhost:3000/"
echo "Username: admin"
echo "Password: admin"
1 change: 1 addition & 0 deletions examples/applications/flare/flare-text-generator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ pipeline:
logprobs: 5
logprobs-field: "value.tokens"
max-tokens: 100
stream: false
prompt:
- |
There is a list of documents that you must use to perform your task.
Expand Down
Loading

0 comments on commit 4171599

Please sign in to comment.