Skip to content

Commit

Permalink
Document workaround for #1565
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristophRose authored Apr 21, 2020
1 parent 34ab0c3 commit fc6b93b
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion doc/source/python/python_component.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,12 @@ class ModelWithMetrics(object):

Note: prior to Seldon Core 1.1 custom metrics have always been returned to client. From SC 1.1 you can control this behaviour setting `INCLUDE_METRICS_IN_CLIENT_RESPONSE` environmental variable to either `true` or `false`. Despite value of this environmental variable custom metrics will always be exposed to Prometheus.

Prior to Seldon Core 1.1 not implementing custom metrics logs a message at the info level at each predict call. Starting with Seldon Core this is logged at the debug level. To supress this warning implement a metrics function returning an empty list:

```python
def metrics(self):
return []
```

## Returning Tags

Expand All @@ -139,7 +145,7 @@ If we wish to add arbitrary tags to the returned metadata you can provide a `tag
A simple example is shown below:

```python
class ModelWithMetrics(object):
class ModelWithTags(object):

def predict(self,X,features_names):
return X
Expand All @@ -148,6 +154,13 @@ class ModelWithMetrics(object):
return {"system":"production"}
```

Prior to Seldon Core 1.1 not implementing custom tags logs a message at the info level at each predict call. Starting with Seldon Core this is logged at the debug level. To supress this warning implement a tags function returning an empty dictionary:

```python
def metrics(self):
return {}
```

## REST Health Endpoint
If you wish to add a REST health point, you can implement the `health_status` method with signature as shown below:
```python
Expand Down

0 comments on commit fc6b93b

Please sign in to comment.